Apple's modern language for iOS, macOS, watchOS, and tvOS. Fast, safe, and designed to be friendly to beginners and powerful for experts.
← Back to Client SideInt? vs Int).struct Customer { let name: String let age: Int var isAdult: Bool { age >= 18 } } let adults = customers .filter { $0.isAdult } .sorted { $0.name < $1.name } // async/await with optionals func loadUser(id: Int) async throws -> User? { let (data, _) = try await URLSession.shared.data(from: url) return try JSONDecoder().decode(User.self, from: data) }
A value either has something or it's nil — and the type makes it explicit. Force-unwrap with ! at your peril; safer alternatives are if let, guard let, and ?..
Define behavior with protocol, then extend any type to conform. This protocol-oriented style replaces deep class hierarchies with composable abilities.
Swift encourages structs (value types, copy-on-assign) over classes (reference types). This eliminates whole classes of mutation bugs.
Modern Swift has async/await and actors — types that protect their state from data races automatically.
| Category | Tools |
|---|---|
| IDE | Xcode (Apple), VS Code (server) |
| Package mgr | Swift Package Manager (SwiftPM), CocoaPods |
| UI | SwiftUI, UIKit, AppKit |
| Server | Vapor, Hummingbird |
| Test | XCTest, Swift Testing |
The default — SwiftUI is the future of Apple UI.
Native Mac apps written in Swift.
Smaller form factors, same language.
SwiftUI extends to spatial computing.