iOS Development Guide EP01: Install Xcode and tour its interface
Video
Watch the full video on YouTube:
Introduction
This is chapter one of our series on iOS development with Swift. The goal of the series is to teach you how to build your own iOS applications, and in this first video we prepare the ground: we get to know Swift, install Xcode and take a full tour of the interface of this powerful IDE.
Before writing the first line of code it is important to understand which tools we are going to use and how they are organized, because all iOS development happens inside Xcode. If you have never opened this editor, this video will serve as a map so you do not get lost.
What is Swift?
Swift is Apple’s programming language for building iOS and macOS applications. Fun fact: it was developed in secret in 2010 and did not see the light until WWDC 2014. One year later, in 2015, it was re-released as open source and the community has maintained it ever since.
Even though it is a cross-platform language, you need to be on a Mac to develop iOS or macOS applications. That does not stop you from working with Swift on Linux or Windows, where you can build command line applications, your own backends or even embedded applications for hardware.
Installing Xcode
The simplest way to install Swift on macOS is to download Xcode from the App Store, because Xcode itself takes care of installing Swift and any other development tool you need.
To do this, we open Spotlight with ⌘ + Space, type “App Store” and, once inside, search for “Xcode” and download it. Keep in mind that Xcode is quite heavy and consumes a lot of resources, so make sure you work on a machine that can handle it and with enough disk space.
Once installed, when you open it you will see three options: open a project, explore a project or create a new project. In this case we are going to create a Playground, because before we start developing applications we need to get to know the language, and the Playground is the best place to do it.
If you want to verify that the installation went well, you can check the Swift version from a terminal:
swift --version
Tour of the Xcode interface
When you open the Playground, Xcode shows its interface. The navigators button (top left) opens the sidebar with several panes: the file list, the Git log, bookmarks (to mark lines of code as shortcuts), the search, the diagnostics panel (warnings, errors and info), the test suite, the debug session with its breakpoints and the runner, which shows local or cloud execution.
To the right of that button we find the AI conversation panel. Xcode natively implements AI assistants, and from there you can send messages to your configured agent. In the center we have the device selector where we choose where to run our applications (in this case, only the Mac, because we are in a Playground).
At the top we can also open additional tabs and panes to work on several files in parallel, and the layout menu lets us place the canvas on the right or bottom, enable the line comparator to see Git changes, the minimap, the authors of each line, code coverage and more. Each of these options is personal configuration: the recommendation is to keep it as minimal as possible.
Finally, at the bottom is the console, where you will see the output of your print calls. To its left is the debug console, which shows debugger information when you stop execution at a breakpoint. We will see all of this in detail in a practical way as the series progresses.
Initial setup
Before starting to write code it is worth configuring a few things: your Apple account, your AI agent and, if you come from other editors like Visual Studio Code, your preferred shortcut. In the Xcode components section you can download the different devices and simulators you will use for your iOS or macOS applications.
As personal advice, you should create an account on GitHub, GitLab or your preferred Git hosting from day one: that is where all the projects in the series will live.
Your first code in the Playground
If you already have Xcode installed, you can get ahead and try your first line of code in the Playground before the next chapter:
// Your first line of Swift code in a Playground
let name = "Angel"
print("Hello, I am \(name)")
In the next videos we will cover the fundamental topics to understand Swift: data types, data structures, basic programming algorithms and blocks for handling data control flow.
Best Practices
- Install Swift through Xcode from the App Store (you do not need to install Swift separately).
- Verify your installation with
swift --versionbefore you start practicing. - Create a GitHub or GitLab account to version your projects from day one.
- Practice in Playgrounds before building your first full application.
- Keep the Xcode interface as minimal as possible and hide what you do not use.
Conclusion
In this chapter one of the iOS development series with Swift we installed Xcode, created our first Playground and learned how to navigate its interface: navigation panes, console, debugger, simulator canvas and AI assistant. The environment is ready, so in the next chapter we start writing code directly with the basic syntax of Swift and its data types.
If you want to follow the series, like the video and subscribe to the channel so you do not miss the next chapter.
