IOS MVC, MVVM

Source: Internet
Author: User

In the iOS app, if you use the traditional MVC pattern, the model layer is the data, the view layer is the storyboard,nib file or the code to build the UI, the controller layer is viewcontroller, responsible for coordinating model and view, The business logic is processed, and the model's data is displayed to view, but the iOS app has a strong coupling between view and Viewcontroller, which leads directly to the Viewcontroller sometimes becoming very large.

The improved MVVM pattern, known as Model-view-viewmodel, is essentially mvc,viewmodel equivalent to a controller, Unlike the traditional MVC pattern in iOS, the Viewcontroller is divided into the view layer in the MVVM mode, since Viewcontroller is so strongly coupled with view that it simply rubs them two together as a view layer, The model layer does not change, in addition to abstract a viewmodel layer, the original placed in the Viewcontroller layer of business logic into the ViewModel.

IOS MVC, MVVM

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.