Li Hongqiang iOS Development-a review of web news acquisition data

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.