MVVM mode developed from scratch for Ios (1)

Source: Internet
Author: User

MVVM mode developed from scratch for Ios (1)

1. previous projects have been using mvc to develop ios and found that ios has a drawback. In mvc, there is a lot of business logic in viewcontroller. When it is constantly modified, it is only a painful process.

2. I have previously worked on wpf and used the mvvm mode. I can put the business logic in the vm mode, and the vm can process the business logic. I have worked on several ios projects and thought about the mvvm mode, but I have never found it. Occasionally, I see an ios project in mvvm mode on the Internet. I will try to do this project from the beginning, and the source code will be published after the project is completed.

3. OK, this mvvm open source project is C-41, interested can go to the Internet search.

4. This project is associated with some class libraries. ios has a cocopods project management tool that can be configured by myself. I have already configured it.

5. Create a new project and create a Podfile in the project directory. Enter

Target "MyTools" do

Pod 'reactivecocoa ', '2. 1.8'

Pod 'libextobjc', '0. 3'

Pod 'reactiveviewmodel', '0. 1.1'

Pod 'uicolor-Utilities ', '1. 123'


Inhibit_all_warnings!


End


Target "MyToolsTests" do


Pod 'specta ',' ~> 0.2.1'

Pod 'expecta ',' ~> 0.2.3'

Pod 'ocmock ',' ~> 2.2.1'


Inhibit_all_warnings!


End


6. Run the pod install command to automatically download and add it to the project.

7. An error will be reported when the project is running. XCTest/XCTest. h file not found built in Xcode 6

8. if you encounter this error, you can check it online. I found a suitable answer in stackoverflow. in my remarks, this website is sometimes very slow in China, it is recommended that you create a software program that turns over the wall. Now I use a cloud ladder, which is easy to configure.

9. In order to fix this for any CocoaPod dependencies you need to add the followingFRAMEWORK_SEARCH_PATHSIn any Pod target that requires XCTest (e.g. Kiwi, Specta, FBSnapshotTestCase, etc ).

$(PLATFORM_DIR)/Developer/Library/Frameworks

10. You need to add $ (PLATFORM_DIR)/Developer/Library/Frameworks to the class Library that reports an error. This is added to BuildSettings-> Search Paths-> Framework Search Paths.

11. Run our mvvm architecture project. A project will be started later.


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.