I read several questions on programmers.stackexchange.com to determine if this question is better asked there. I think this question belongs on SO, but I’m not completely sure.
I have a basic knowledge of Objective-C and UIKit. I have read, a few years ago, most of Cocoa Programming for OS X (2nd Edition) by Aaron Hillegass; this is where the majority of my knowledge stems. The rest is from various sites, SO questions, the SDK documentation, and small personal projects (both OS X and iOS).
I am starting an iOS (specifically, iPhone) project for the university at which I work. This application will have distinct sections with distinct functionality. Some examples of “sections” would be: a virtual student ID card, current semester’s class schedule (for the user), a campus map, etcetera. I want to be able to add new sections easily in future versions of the application. Thus, I want to design the project such that a section is an independent, from the main project, group of code (as much as possible).
In addition to being able to add new features by creating new modules, I want the project to be usable by more developers that just myself. That is, I want other developers on my team to be able to develop new modules for the application by following a “best practice.”
Currently, I am basing my project around a UITabBarController with my “modules” being new UIViewControllers and NIBs. I get the feeling that this might not be an optimal way of establishing my project. Thus my question:
What are some best practices for such a project as I have described?
I think you’re on the right track. UIViewControllers are a good way to break this up.
UITabBarControllers are often awkward when you have a lot of options; a welcome screen with a table view of possibilities might be more expandable. See, for example, Facebook’s left panel or the built-in Settings app.
I typically find that the hard part about reuse in iOS projects is not the view controllers (which are typically well isolated) but the underlying infrastructure such as that for network requests, data storage, account management, etc. You might want to start with an existing framework for this (like, say, Parse or RestKit), or at least look at how they break things up.
On the topic of good, reusable iOS design, you might find Matt Gemmell’s post about API design helpful, if not exactly what you’re looking for.