What's a 1.AFNetworking?
The Web requests an open source framework that both iOS and Mac OS can use.
What's a 2.SwiftyJSON?
Another open source framework for working with JSON data (parsing data, generating data).
3. Let's introduce afnetworking, Swiftyjson:
3.1. Find the address of your project: (By the way, a shortcut key, option+command+c, copy the path of the file or folder)
/users/jimi/documents/ios/demo/myy
3.2. Open terminal, input, enter:
Cd/users/jimi/documents/ios/demo/myy
3.3. Create a Podfile:
Touch Podfile
3.4. You can choose to use the command line editing, such as: "Vim Podfile" Enter, start editing, press "I", insert, insert the following statement, press ESC, press:, press wq+ Enter, save exit.
Alternatively, you can copy the following statement directly into the Podfile file:
# Settings support minimum platform Platform:ios, ' 8.0 ' target ' Myy ' do# if it is a swift project, add "use_frameworks!" use_frameworks!# If you want to use a fixed version you can write as follows # pod ' afnetworking ', ' ~> 3.2.1 ' pod ' afnetworking ' pod ' swiftyjson ' end
3.5. Start the Download introduction:
Pod Install
4. You can open a project that introduces a third-party framework, open this file, and you can:
/users/jimi/documents/ios/demo/myy/myy.xcworkspace
5. In this way, we are introducing 2 open source frameworks at the same time. Introduced the latest version, if you have special needs, you can write the same as the annotation, the introduction of the specified version.
6. Next, we implement the network request.
7. Recommended blog post: https://www.jianshu.com/p/9e4e36ba8574
iOS Development-Login Interface Development (4) Introduction of Afnetworking-swfit4.1_xcode9.3.1