I managed to get it to work this link.
Then, in the bridge header file, I imported the AFNetworking framework, as in any framework. I also imported BButton.h, which is a third-party library that is not a pod infrastructure, but something that I placed directly in my project
#import "BButton.h" #import <AFNetworking/AFNetworking.h>
Then in the Swift file calling the AFNetworking code, I had to import AFNetworking, but not BButton
import UIKit import AFNetworking class RootViewController: UIViewController { @IBOutlet weak var emailButton: BButton! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. // Set the icon for the email signup button self.emailButton!.setTitle(NSLocalizedString("", comment: ""), forState: UIControlState.Normal) self.emailButton!.setType(BButtonType.Primary) self.emailButton!.addAwesomeIcon(FAIcon.FAEnvelope, beforeTitle: true) let manager = AFHTTPRequestOperationManager() manager.GET( "http://headers.jsontest.com", parameters: nil, success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) in println("JSON: " + responseObject.description) }, failure: { (operation: AFHTTPRequestOperation!, error: NSError!) in println("Error: " + error.localizedDescription) } ) } }
Hope that helps
source share