Over the last seven years, our team at Originate has created countless iOS apps. Along the way we have continuously fine-tuned our iOS development process, creating best practices that we apply to every new app we build.

We’ve put some of this down on paper in the form of two checklists, one used when starting an iOS project, and one used when preparing to submit to the App Store.

Following these checklists has helped our team work together more efficiently, architect better solutions, reduce development time, and reduce the risks that come with publishing an app to the App Store.

We hope these checklists will do the same for you.

Repo/GitHub a. Start by creating a new repo in GitHub and adding the appropriate iOS gitignore file. b. Be sure to follow the git-flow workflow, with master holding your App Store builds, dev your latest development code, and feature branches holding the current work in progress.

Xcode a. Make sure everyone in the team is on the same version of Xcode. b. Turn on “Analyze during build” and “Treat Warnings as Errors” (Set it under “Build Settings” in your application target). c. Turn off tabs and use spaces: XCode > Preferences > Text Editing > Indentation > Prefer Indent using Spaces, Tab width 2, Indent width 2.

Jenkins/OS X Server/TestFlight Setup CI/CD (Continuous Integration/Continuous Deployment) making sure with every push to dev all tests are run and an Ad Hoc build is created/emailed to the team (with the commit logs in the email body). If the build or tests failed, a failure email should instead be sent out to the team. At Originate most of our iOS projects use OS X Server integrated with TestFlight.

Coding Style/Standards a. Follow Apple's recommended iOS coding style guide. b. In addition, follow recommendations here: http://qualitycoding.org/preprocessor/ c. Keep your .h files short and simple, exposing only what is needed by other classes. Move all other methods, properties, instance variables declarations, etc. inside the .m file. d. Name your view controllers based on the page they are displaying (e.g. LoginViewController ). e. Organize your project navigator and files using groups. Good group names are Data Models, Views, Controllers, App Delegate, Supporting Files, Tools, etc. Messy project navigators should not be accepted. e. Before submitting a pull request, go over the checklist at the bottom of our effective code review blog post and look for red flags.

Architecture a. MVC (Model View Controller) is sometimes jokingly called Massive View Controller in iOS development. These massive controllers that do everything are common mistakes for beginners. They are not acceptable. As needed, split out table related delegates/data sources from the view controller into their own separate classes. Split out views (especially if they are reused) into their own view classes. Make sure helper methods are pushed out into helper classes. In addition, the View Controller should not make any calls to the server, instead the Model or a manager class should handle this. b. Some good sample code/tutorials/patterns: Lighter View Controllers, Viper and BrowseOverflow (from the iOS TDD book).

Views/Nibs/Storyboards a. Be sure to use constraints/autolayout for your views and support different screen sizes. Otherwise you will have to manually configure the frame sizes/positions for each view to make sure it fits correctly for each screen size. PureLayout and FLKAutoLayout have been used on some projects at Originate. b. Determine if Nib files will be used. Originate recommends avoiding them, but leaves the decision to the Tech Lead. Storyboards are not used as they they are hard to manage with multiple developers (e.g. trying to merge a storyboard), slow down Xcode, and add a level of complexity to the code that is not necessary. c. Use FrameAccessor to modify frames if needed. This will make it very easy to get and set a UIView ’s size and origin.

Fonts and Colors Standardizing fonts and colors throughout the app (i.e. create helper classes) so that it's easy to maintain/modify them as needed. This also makes for cleaner code that doesn’t have random RGB or font strings scattered in the views.

Display text a. All strings displayed to the user must be placed in a localization file. b. Avoid using image assets that contain text, use a UILabel instead, pulling the text out of the localization file.

Analytics http://replay.io is our go-to platform for analytics at Originate.

Crash reporting Although Apple and iTunes Connect are making progress here, it’s still best to use a third-party tool like Crashlytics. They work much faster and have a better UI/reporting interface.

Add AOP support if needed (e.g. for logging).

Third party code dependencies Cocoapods can be used to maintain third-party dependencies. At Originate this decision is left to the Tech Lead.