This project is an iOS prototype app for demonstration.
All code of the project should follow the style of NYTimes Objective-C Style.
The architecture follows the MVVM(Model-View-ViewModel) pattern. The relationships between the three components of the MVVM pattern are simpler than the MVC equivalents, following these strict rules:
- The View has a reference to the ViewModel, but not vice-versa.
- The ViewModel has a reference to the Model, but not vice-versa.
The MVVM pattern relies on data-binding, which is implemented by utilizing ReactiveCocoa.
The main advantage of view model is that it decoupling the business from UI level and can be test easily.
StoryBoards should be splited into individual files according to the module and reference each other for collaboration purpose.
StoryBoards is mainly used to designate the worflow and relationship between each scenes. Some unuseable screen chould directly be drawed by storyboard and other screen should still be drawed by code.
Localization Strings File is /Storyboards & Localizations/Localizable.strings
and all definitions are manipulated through macros defined in header file NOSLocalized{ModuleName}.h
which are include in header file NOSLocalizedMacros.h
.
NOTE: The header file NOSLocalizedCommon.h
is used to define macro used accross multiple modules.
The font definitions and color defitions are defined in the header file NOSConstants.h
which also include the header file NOSLocalizedMacros.h
mentioned above.
Image Recesources are defined in /Resources/Images.xcassets
and they are grouped by module.
They should be named as one camel case string with a description of their purpose, followed by the un-prefixed name of the class or property they are customizing (if there is one), followed by a further description of color and/or placement, and finally their state, which is expounded in the NYTimes Objective-C Style.
Using RestKit as RESTful web services clients. And take SQLite as persistent store so that the app could still present data even if the network failed.
Environment configuration files are NOSEnvironment-{stage}.plist which located in /Supporting Files
Directory. They are manipulated throught the NOSEnvironment
utility class.
All test case described with BDD style using Speckta. And assertions are asserted with Expecta.
Objects are mocked with OCMockito and networking operations are mocked with OHHTTPStubs.
NOTE: Data fixtures are defined in path /Fixtures
of test bundle.
// TODO
- Xcode 7.0+
- iOS 9
ruby Dummy\ Server/server.rb
The building process below using xctool
. You also can build with xcodebuild
.
xctool -scheme NoodlesStu-iOS -sdk iphonesimulator -workspace NoodlesStu-iOS.xcworkspace/ -destination "name=iPhone 6" test
Note: This might not work with xcode7
xctool -scheme NoodlesStu-iOS -sdk iphoneos -workspace NoodlesStu-iOS.xcworkspace/ archive
- UI Test
- ViewModel Test
This project is licensed under the terms of the Apache License, version 2.0. Please see the LICENSE file for full details.