One of the first steps in creating an app is building the app's project. This video shows how to create an Xcode project and how Xcode projects differ from projects created for other platforms.
- [Todd] When you open Xcode for the first time you're going to see the Welcome screen. That's this screen I have right here, that enables you to quickly get started by creating an Xcode project or opening a recent project, if you have any. So what we're going to do from here is create a new Xcode project from the welcome screen by clicking the button. When you click that button Xcode is going to present a list of templates to you. Templates are organized by platform. So you can see the platforms in this top bar right here.
So we have IOS, watchOS, et cetera. For this course, we're going to stick with IOS, and we're going to use a Single View Application. Now, if you've gone through previous iterations of this course, you may notice that we're going to be doing something different in this course. In previous iterations, We used the Master-Detail Application template. That pretty much does most of the work for you in creating a note-taking app. This time I opted to create the entire app from scratch by using the Single View Application template.
Which is essentially a blank project template with a blank screen. So I'm going to choose that and then hit next. For the Product Name I'm going to call this, Plain Ol' Notes. I'm going to leave the Team at the default which is my name and you may not see a Team right here, if you click the drop-down menu, you should probably see None. A Team is something you can add later on that's for publishing your application and testing on a device with all of the features for IOS enabled.
For what we're doing in this course, you actually don't need to have a Team set up. For Organization Name you can leave your name. For the identifier, I'm using a reverse domain structure, so I have a unique Bundle identifier. This applies when you release your app in the App Store, so you can give your app a unique ID. For the purpose of this course, it doesn't really matter what you have as your Organization identifier. But it's typically recommended to use a reverse domain structure if you plan on releasing to the App Store.
That is, since I own toddperkins.com, I reverse that and have my identifier be com.toddperkins which gives me this unique Bundle identifier, when coupled with my product name. So long as nobody else uses my Organization identifier, then I have this completely unique ID. So for the Language choose Swift and for Devices choose IPhone. Leave the rest of these options unchecked and hit next.
Xcode then asks where you want to save the project. I'm going to save it in Exercise Files, Chapter 03, create app, final. If you're following along with the exercise files, don't save it inside this final folder. Just save it right outside of that folder right in here. I'll hit Create and we've successfully created an Xcode project and we're inside of Xcode. On the left side of the screen, you're going to see something called, The Project Navigator, which is a list of files and groups.
Note that I said the word, groups, instead of folders. Xcode allows you to group files together independently of the file system. So I'm going to Tab over to Finder and navigate to the project that I created. It's in Exercise Files, Chapter 03, create app, final. Yours is going to be in a different folder than that. So, in there, you'll notice that there's a folder with the same name as our project. So I'm going to click on that project and see that it has a sub-folder of the same name.
If you double-click this file, that's the fastest way to get back into this project in Xcode. Inside of there, we have this sub-folder, Plain Ol' Notes. Now up to this point, it pretty much matches what I'm seeing in Xcode right here. But after this, it doesn't. Inside of this Plain Ol' Notes folder, which corresponds to this folder icon right here, we see five different files, or rather, three files and two folders.
Here I see six items. One of them looks like a folder. So I just want to point out that Xcode doesn't necessarily match the file system. These yellow folder icons right here, are actually called groups and you can create them to organize your files, by Shift-clicking multiple files, right-clicking, and then choosing New Group from Selection. That puts them inside of a group which I can then name.
I'll expand it and my files are in there, if I Tab back over to Finder, I don't have any additional folders created. You can also create a new group by right-clicking and choosing New Group, then you can click and drag files in and out of the groups to organize them. So what I'm going to do is just select these two files, let's select the top one, Shift-click the next one, drag them out of the group, select the group, right-click and choose Delete. So we've successfully created our project for this course, and we've looked at how the files inside of our file system are not necessarily mirroring what we're seeing in Xcode.
In this course, join Todd Perkins as he takes you through how to create cross-platform apps using Swift. This course is one of three related courses designed to help you discover the similarities and differences that exist between the platforms used by three main devices: an Android phone, an iPhone, and a Windows phone. These courses use the same assets to create the same note-taking app so that you can identify and experience the complementary and contrasting development steps.
- Downloading Xcode
- Configuring preferences in Xcode
- Building the app interface
- Connecting interface elements to code
- Writing app logic