Li Hongqiang iOS Development-a review of web news acquisition data
01 Creating a tool class that inherits from Afhttpsessionmanager:lhqnetworktool
Used to send network requests for data
1.1 Defining class methods returning singleton objects
1.2 Single-instance implementation, setting BaseURL, setting the timeout length, etc.
02 Create a taxonomy, pass in the parameters of a class, return an array, return all the properties of the current class
Working with model data in a model
03 Creating a picture the Carousel model class sends requests to get the data for the carousel picture
3.1 Defining attributes: Title, picture
Define two class methods: (1) A carousel picture that passes in the parameters of a dictionary
(2) Get image data successful callback (array callback), failed callback (error parameter)
3.2 Gets all the properties of the current class, and iterates over the assignment to the property
3.3 Send network request, use callback function to get network data
04 Create picture The Carousel controller inherits from
Uicollectionviewcontroller
Get an array of carousel data from a callback function in the model class
and prints the results, the results are successfully obtained
Li Hongqiang iOS Development-a review of web news acquisition data