Objc China-Study Notes 1-lightweight View Controllers, objccontrollers

Source: Internet
Author: User

Objc China-Study Notes 1-lightweight View Controllers, objccontrollers

Objc China-Study Notes 1-lightweight View Controllers

Objc Original article link: http://objccn.io/issue-1-1/

Method: 1. Separate Data Source from other Protocols
For details, see demohttp: // download.csdn.net/detail/baidu_22932825/8534365.
2. Move the business logic to the Model.
For example, if the server sends us a time to display the completion time of the item in tableView, We will display it in the form of weeks on the interface, at this time, we should add the attribute of the day of the week to the model, and then pull the attribute directly in the controller to convert the time to the day of the week and write it in the category of the object class, of course, this distance is not appropriate, but it probably means that the second processing method of data in Modal should not be implemented in controller, but should be more appropriate, let viewController simply get the processed result
3. Create a Store class
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.