← Back to blog

Starting a project in Xcode

A guide to creating a new project in Xcode: available templates, initial configuration options, and differences between SwiftUI App and UIKit App Delegate.

To start a project, Xcode provides different templates and starting points. Let’s explore the most popular ones.

When you click the Xcode icon, the welcome screen appears with three main options: create a new project, clone a project from a Git repository, or open an existing project on your machine.

If you select the first option, the template picker screen appears.

Available templates

What you see are all the possible options Xcode gives you to create an application. First you see the platform: iOS, macOS, watchOS and tvOS.

Then you see the template to create:

  1. App: The one you’ll select most of the time — creates an app with a single view.
  2. Document App: For apps based on document reading, like the Files app.
  3. Game: Creates a basic app for games.
  4. Augmented Reality App: An augmented reality application using ARKit.
  5. Sticker Pack App: Apps with a collection of stickers for the Messages app.

For this tutorial we’ll select the first option.

Initial configuration

Here you fill in some initial configuration parameters for the application:

  • Product Name: Your app’s name.
  • Team: If you already have a developer account, you can add it in Preferences under Accounts.
  • Bundle Identifier: The unique identifier for your application. Must be in reverse-domain format (example: dev.slekens.myapp).

The most important options to highlight are:

  1. Interface: Two choices. SwiftUI, which comes by default and is Apple’s new development standard. The other option is Storyboard using UIKit.
  2. Life Cycle: Similarly, SwiftUI App or UIKit App Delegate (the traditional option).
  3. Language: Depends on the Interface selection. If SwiftUI, Language will always be Swift. If Storyboard, you can use Objective-C.
  4. Use Core Data: Xcode creates the base classes for local persistence with Core Data. The next checkbox adds iCloud support.
  5. Include Tests: Creates the necessary test projects — both unit tests and automated UI tests.

Main differences between templates

The differences are most notable in the app’s lifecycle. If you choose UIKit App Delegate with Core Data, Xcode generates all the base code in the AppDelegate class. If you choose SwiftUI App, it creates much less visible code, though this doesn’t mean the lifecycle is omitted — it just doesn’t expose it explicitly.

In short, SwiftUI helps us create apps faster and more readably. Though it’s always advisable to have a solid UIKit foundation — you’ll understand many key concepts in app creation that SwiftUI abstracts away and makes seem nonexistent.

Something worth appreciating is how persistence base code is created. While in the AppDelegate scheme all the code is created in that single class, in SwiftUI it creates a separate class — which makes the code much more understandable for those just starting out. This base is created as a Singleton, one of Apple’s preferred design patterns used throughout all system libraries.

Which one to choose?

Either approach is correct and fully functional for starting a project. The key thing to keep in mind is that SwiftUI is only compatible from iOS 13 onward and still has room to grow. On the other hand, UIKit has been with us for a long time and there’s more support and information available for it.

Whichever direction you choose, this blog will help you understand the basic and advanced concepts of iOS development.