High-level Overview of Swift, Xcode, and iOS Development
This is an overview of tools for mobile iOS development.
It comes from the perspective of a novice who is just getting started.
iOS
The two dominant operating systems on mobile devices are iOS and Android.
iOS is developed by Apple and is specifically designed for its devices, such as the iPhone. It was first announced in 2007.
Swift & Objective-C
Objective-C is a legacy language used for macOS and iOS development before Swift’s introduction. It was originally developed in the 1980s.
Swift is a modern, general-purpose programming language introduced by Apple in 2014 as a replacement for Objective-C.
Swift versions 1.0 through 6.0 were released in 2014, 2015, 2016, 2017, 2019, and 2024, respectively.
Xcode
Xcode is the only IDE for Swift development. It was first released in 2003.
In recent years, Xcode has maintained a yearly release schedule. The formula is Xcode version $V$ is released in the year $2008+V$ for $V = 5, 6, \dots, 16$. For example, Xcode 16 was released in 2024.
Here are the top three most useful Xcode shortcuts:
- ⌥ + Click: Access quick help.
- ⌘ + Click: Jump to the definition.
- ⌘ + N: Create a new file.
SwiftUI & Storyboard
SwiftUI and Storyboard are the two main frameworks for building user interfaces in iOS applications.
Storyboard was introduced in 2011. A developer drags and drops UI elements onto a canvas and defines constraints between them.
SwiftUI was introduced in 2019. A developer builds user interfaces via composable views, which are modelled as Swift structs.
State Management
SwiftUI has at least three mechanisms for state management.
Managing state with structs: state-holding properties are marked with the @State
and @Binding
property wrappers.
Managing state with classes: the class itself conforms to the ObservableObject
protocol, and state-holding properties are marked with the @StateObject
and @ObservedObject
property wrappers.
Managing state with environment objects: the state class conforms to the ObservableObject
protocol and is marked with @StateObject
on initialisation. It is passed to a main view using the environmentObject
method. Any direct or indirect child view of the main view can access that state by marking a property with the @EnvironmentObject
property wrapper.
Top 3 Best Bits
It is easy to get started; downloading Xcode is all that's needed.
The named arguments feature of Swift allows one to distinguish between identically named functions with identically typed parameters by using differently named parameters.
Xcode breakpoints can be customised to be ignored, skipped a set number of times, and/or perform certain actions like console logging.
Learning Resources
The Apple Pathways is the free official resource, guaranteed to align with Apple's latest standards.
The 36-hour Pluralsight iOS Development Skill Path offers a comprehensive introduction but requires a Pluralsight subscription, and the courses are a mixture of old (Storyboard) and new (SwiftUI) material cluttered together.