Swift and AFNetworking integration
Now as swift is the new language to develop iOS apps.
How can we integrate with the AFNetworking or
using NSURLSession will be a better option ???
Please help me out..
- How to use NSURLCache to return cached API responses when offline (iOS App)
- AFNetworking: Handle error globally and repeat request
- AFHTTPSessionManager to use SOAP based service
- AFnetworking downloading multiple files
- send image along with other parameters with AFNetworking
- How to immediately force cancel an NSOperation with AFNetworking?
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:
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
- How do I get the current version of my iOS project in code?
- keyboard resigning reduces popover height
- Merging NSArrays in Objective-C
- Blocks retain cycle from naming convention?
- Is there a way to remove the separator line from a UITableView?
- In App Purchase causes occasional crash
- How to create IPA in Xcode 7?
- method vs function vs procedure vs class?
- LZMA SDK decompress for iOS (xcode) using too much RAM
- How to concatenate 2 or 3 audio files in iOS?
- How do you disable auto build in xcode
- Dynamic size UICollectionView cell
- .dll Equivalent on Mac OS X
- Run XCTest bundle with simctl
- Swift: Extra argument 'error' in call