Join Todd Perkins for an in-depth discussion in this video Creating the project, part of iOS App Development: Apple iCloud API (2013).
Now let's create the project for the app. In Xcode, click Create a new project or go to File > new project, and choose under iOS > Application > Master- Detail Application template. This template isn't far away from what we want the end result of our notes app to be, so it's going to help us a lot. I'll click Next, for Product Name I'll type Plain Ol' Notes, for Organization Name I am going to leave that blank, for Company Identifier I am going to put my reverse domain structure which is com.toddperkins.
Of course you could use your own here if you want. For Devices choose iPhone and then check Use Storyboards and Use Automatic Reference Counting. And click Next. I am going to save this in the Chapter_01 folder in the creating_project folder and click Create. In the project I am going to go to MainStoryboard.storyboard, and I am going to scroll over to find the MasterViewController and change Masters to Notes, and then I'll go to the DetailViewController and change Detail to Note.
This is going to the single note view. Then I am going to replace this UI label with a UI Text view, so I'm going to scroll down in the Object area until I find text view, and just drag and drop that into place, making sure it's aligned properly, and now I'm going to go to the DetailViewController.h and make a small tweak to the code. I'm just going to change UILabel to UITextView, and I'm going to change detailDescriptionLabel to tView, and I'll save that file and go to DetailViewControl.m and make sure I change where the detailDescriptionLabel is mentioned to tView. And then we'll need to go back to that storyboard and make the connections.
So I'll save this file and go to MainStoryboard.storyboard, click the Connection inspector button, click Detail View Controller on the left side of the screen, and then just click and drag from tView onto that text view so the connection is made. So now you should be able to save and test the app in the simulator. And simulator you see Notes, I can click plus to add a new item, I can add as many as I want, and it shows the timecode of the item, and if I click it, and I see the value in that UITextView.
So now I've successfully created our project and set up the storyboards.
- Understanding the class structure of an app
- Building the data model and constants
- Making your app compatible with the Apple Developer portal
- Connecting to iCloud
- Understanding the UIDocument class
- Handling document metadata class
- Opening, closing, saving, and deleting documents from iCloud