Failed to import bridging header

I answered this in another post: Chartboost integration issues with XCode 6.1

EXPLANATION:

It seems like some pods and libraries don’t bother importing the basic frameworks as they expect your code to already have them. This doesn’t work with Swift as the way to import frameworks changed.
All you need to do is to add the frameworks needed in your bridging header file.

ANSWER:

It depends on what errors the compiler throws.
If it complains about NSObject, NSString, etc… you need to add
#import <Foundation/Foundation.h> in the top of your bridging header file.

If it complains about UIView, UIButton, etc… you need to add #import <UIKit/UIKit.h> in the top of your bridging header file.

Leave a Comment