I'm working on a project in Xcode written in Swift. I'm using two pods, AFNetworking
and BDBOAuth1Manager
. They're both Obj-C libraries, so a simple bridging file to import them takes care of everything.
Now, the problem arrises when I try to include a third pod, SwiftyJSON
, that's written in Swift. Here's what the Podfile looks like:
platform :ios, "8.0"
use_frameworks!
pod "AFNetworking"
pod "BDBOAuth1Manager"
pod "SwiftyJSON"
link_with 'TwitterSearch', 'TwitterSearch Tests'
After installing the above Podfile, the bridging header stops working, because it now it can't find the files I'm trying to import.
To clarifty, this is the bridging header file:
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "BDBOAuth1RequestOperationManager.h"
It works when the Pods are just AFNetworking
and BDBOAuth1Manager
, which are written in Obj-C. It doesn't work when a third pod, SwiftyJSON
, written in Swift, is included.
The exact error messages are:
- Swift compiler error: "BDBOAuth1RequestOperationManager.h" file not found
- Swift compiler error: Failed to import bridging header
path-to-bridging-header
Any idea what this might be?
UPDATE: I've figured out why it wasn't working. When I manually added in SwiftyJSON, everything worked fine. The entire problem roots back to this line: use_frameworks!
I'm not at all familiar with frameworks, but practically speaking you'd have to do the following:
#import "path/BDBOAuth1RequestOperationManager.h"
instead of
#import "BDBOAuth1RequestOperationManager.h"