Swift and AFNetworking integration

2 Solutions Collect From Internet About “Swift and AFNetworking integration”

You have to add AFNetworking to your swift project

In Build Settings -> Defines Module set to Yes

In Build Settings -> Swift compiler -> Objective-C bridging file set the name of bridging file ‘ProjectName-Bridging-Header.h’ for example

In ProjectName-Bridging-Header.h write:

#import "AFNetworking.h"

Any Objective-C framework (or C library) that’s accessible as a module
can be imported directly into Swift. This includes all of the
Objective-C system frameworks—such as Foundation, UIKit, and
SpriteKit—as well as common C libraries supplied with the system. For
example, to import Foundation, simply add this import statement to the
top of the Swift file you’re working in:

you just need to import them into your project and create bridging header. you can find detailed explanation How to call Objective-C code from Swift