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