![]() ![]() Once you are familiar with UITableView, it is trivial to recreate an interface like this from scratch. If you have never worked with table views before, this is a good starting place for your first experiments. The MasterViewController class (inheriting from UITableViewController) implements a fully functional table view controller that manages an array of simple data objects (instances of NSDate, in this case) and acts as the data source for its table view. For instance, the two content view controllers can be largely ignorant of the specific device they run on. #XCODE PROJECTS CODE#It is important to note how much code can be shared between both targets and how little code is device-family-dependent. ![]() #XCODE PROJECTS HOW TO#This app template is a good reference on how to set up a Universal application (or two separate apps for iPhone and iPad) from a single codebase, despite seemingly big platform-dependent differences in the app’s user interface. In all cases, the setup of the view controllers is again quite simple and should be familiar by now. ![]() If you choose to create a Universal app (targeting both iPhone and iPad), it will contain both variants in separate storyboards. The app template for the iPad begins with a UISplitViewController, which in turn contains the master table view on the left and the detail view on the right. The navigation controller contains a table view controller (the master view), and tapping on a row in the table transitions to a second view controller (the detail view). The iPhone version of this template starts out with a UINavigationController as the root view controller. Secondly, the content view controllers actually do include some meaningful degree of functionality and are not just empty placeholders. Firstly, it is the only template that differs significantly depending on the device family (iPhone or iPad) you choose to target. The Master-Detail Application template is interesting for a number of reasons. If you have never worked with a tab bar controller before, you might be surprised to see that the captions and images on the tab bar are actually properties of the respective content view controllers and not of the tab bar itself, but it makes sense from an encapsulation perspective: each view controller should know itself how it wants to represented in a tab bar. ( BOOL ) application :( UIApplication * ) application didFinishLaunchingWithOptions :( NSDictionary * ) launchOptions ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |