Occasionally on the Internet to see a blog about the architecture of iOS, after reading it felt very inspired, so record it, in case forget, also share it for everyone to study together.
Due to my limited project experience and limited understanding of the architecture design, my personal understanding of MVVM is mostly borrowed from the previous MVC web framework-used by the thinkphp framework in school, and the SSH framework, which are MVC's architectural patterns. Today's MVVM is very similar to the traditional MVC, and it can be said to be a sibling, a family.
When it comes to architecture design and teamwork, this is important for app development. Even as a professional brick-and-tile, if you put it in the end of the brick where? Not only the code has the framework, the other things are framed, such as bridges and so on God horse ~ here will not pull out. A good project framework can improve team collaboration efficiency, but also can reduce the redundancy and coupling of code, reasonable division of labor and system architecture design is indispensable.
As far as team collaboration is not just with SVN or Git version control tools, for how to use SVN in iOS development, refer to the previous blog (iOS development version Control (SVN)). A team can work efficiently, I feel that communication is the most important, everyone in the team is more pleasant, and communication is not any obstacle (but there are always a few people in the team), communication in the team is the most important. As for how SVN is used, it's not a thing!
MVVM Interpretation:
The model layer is indispensable, we have to have something to act as a DTO (data transfer object), of course, with a dictionary is also possible, programming, to be flexible. The model layer is a relatively thin layer, if you learn Java's small partners, JavaBean should not be unfamiliar with it.
The ViewModel layer, the binder for the view and model layers, is an excellent place to put user input validation logic, view display logic, initiating network requests, and a variety of other code. To put it bluntly, the original Viewcontroller layer of business logic and page logic and so stripped out to the ViewModel layer.
The view layer is the Viewcontroller layer, and his task is to get the data from the ViewModel layer and display it.
The above for MVVM on the first simple to say, good understanding and application, but also to combat.
Below is an example of the MVVM schema pattern, the following is the first level of the project directory below, each layer of interaction is implemented in the form of block
Project Catalog Description:
Request: The class that stores the network request under the folder, the following will give a specific implementation
Config: is the project configuration file
Resource: Is the project resource file, the following picture resources and storyboard file resources
Tools are: Tool file classes, storing tool classes, such as data regex matching.
Vender: Storage of third-party class libraries
Model: That's not much to say.
Viewcontroller: Store Viewcontroller class resource file, which is the view layer
ViewModel: Store various business logic and network requests
at the end of the article, attach the demo github:Https://github.com/lizelu/MVVM
Give me some SVN commands.
(1), update Local Code command
(2), the code of the submission
SVN info View current local version information
SVN up update to latest version information
SVN St View file status m-Modify D-delete A-add U-Update?-Unknown status-warning C-conflict
SVN add FileName: What if it appears? Generally is the problem when adding files, after the file svn add filename, the status of the file will be changed to a
SVN del fileName: if it appears! This is usually a warning when you delete a file. After executing the SVN del filename command, the file's status is changed to D
SVN ci-m "Reason for submission"
Original http://www.cocoachina.com/ios/20150122/10987.html
IOSMVVM Architecture Design