← Back to Tutorials

1. Introduction to iOS

Getting Started

Overview

iOS is Apple's mobile operating system for iPhone, iPad, and iPod Touch. It powers over a billion devices and provides a rich ecosystem for app development using Swift and Objective-C. The iOS SDK includes Xcode, Interface Builder, Simulator, and a comprehensive set of frameworks like UIKit, Foundation, and Core Data.

iOS Architecture

iOS uses a layered architecture consisting of four abstraction layers:

iOS architecture layers

Figure: iOS layered architecture highlighting the four abstraction layers.

App Lifecycle

iOS apps transition through five distinct states: Not Running, Inactive, Active, Background, and Suspended. The UIApplicationDelegate protocol provides methods like applicationDidFinishLaunching:, applicationDidBecomeActive:, and applicationDidEnterBackground: to respond to state changes.

iOS app lifecycle states

Figure: State transitions in the iOS app lifecycle.

Xcode Overview

Xcode is the official IDE for iOS development. It includes:

Note: iOS development requires a Mac computer running macOS. Xcode is available free from the Mac App Store. You need an Apple Developer account ($99/year) to distribute apps on the App Store.

Swift vs Objective-C

Swift is Apple's modern programming language introduced in 2014. It is the recommended language for new iOS projects:

// Swift
let greeting = "Hello, iOS!"
print(greeting)
// Objective-C
NSString *greeting = @"Hello, iOS!";
NSLog(@"%@", greeting);
Practice Task: Download and install Xcode from the Mac App Store. Create a new "App" project using SwiftUI. Run the default template on the iPhone 15 Simulator. Observe the app's lifecycle by adding print statements in the AppDelegate lifecycle methods.