Join Todd Perkins for an in-depth discussion in this video Creating your first Xcode project, part of Xcode 7 Essential Training.
- When you launch Xcode, you should see the Welcome screen. It's possible though that you've hidden the Welcome screen if you selected it and then unchecked this box to show this window when Xcode launches. If you've hidden the welcome screen, you can show it under Window, Welcome to Xcode. The Welcome screen enables you to quickly get started with a new project or open an existing project. If you look on the right side of my screen where it says No Recent Projects, if you've worked on anything recently, you're going to see a list of those projects here, and you can simply click on them to open them up in Xcode.
You can also click Open another project to open up a project as well. Under Welcome to Xcode you'll Get started with a playground, Create a new Xcode project, and Check out an existing project. A playground is meant for prototyping. We'll talk about playgrounds later on in this course. The repositories is another subject we're going to talk about later on. For now, what we're interested in is clicking Create a new project. Note that you can simply click here or go to File, New, Project or use the keyboard shortcut shift + command + n.
Once you've chosen that option, Xcode opens up, and you're given the chance to choose from an existing template. So your projects, whether for iOS, watchOS, OS X or if you're using Xcode 7.1 or later, tvOS starts with a little bit of existing code. So, under iOS Application I can see several different application starters to choose from, same with watchOS Application, and OS X Application. You can also create a framework or library if you want, but we're not going to be working with those much in this course.
Under iOS Application let's choose Single View Application and click Next. Here I'm asked for a Product Name. Let's call this First App. Then I'm asked to enter an Organization Name. You're also asked to enter an Organization Identifier. This is meant to be part of your Bundle Identifier which is a combination of your Product Name and your Organization Identifier. The Bundle Identifier is the unique ID for your application when you publish it to the App Store. Now, of course, this isn't set in stone, and you can always change it later if you want, but typically developers use a reverse-domain structure.
For example, I own Toddperkins.com, so I use a reverse-domain structure com.toddperkins and then a dot and the name of my app. As long as my app has a unique name, and no one else tries to steal my reverse-domain structure, every time I submit an app to the App Store, the name should be unique on the App Store. For language, I'm going to choose Swift. Note that you can also choose Objective-C if you'd like. For this course though, we're going to be primarily using Swift. For devices, I have iPhone selected, and I'm going to leave that, but note that you can also choose iPad or Universal which is one app that you send to the App Store for both iPhone and iPad.
We're not going to be discussing Core Data in this course, so I'm going to leave that unchecked. If you have interest in Core Data, you can look up the course on that in library. So I'll click Next, and I'm going to create this project right on my desktop. I'll leave Source Control unchecked. Again, repositories are a topic we're going to cover later on, and I'll just click create. So now we've created our first app project in Xcode.
This Xcode tutorial helps new iOS and OS X developers install Xcode and start writing and editing code. Author Todd Perkins also reviews the version control and storyboard features, as well as the basics of Interface Builder, Xcode's intuitive UI design tool. Plus, learn how to compile and debug apps, test apps in the iOS Simulator, and send your app to Apple to be published in one of its app stores.
- What is Xcode?
- File handling in Xcode
- Exploring the code editor
- Creating snippets
- Adding Git version control to your project
- Making interface connections to the code
- Using Interface Builder
- Creating an iPhone or iPad storyboard
- Compiling code with the LLVM compiler
- Sharing resources in a workspace
- Catching common errors with Analyze and Fix-It
- Using the iOS Simulator
- Preparing an app to be published