Swift
Learn Swift 6: optionals, structs, enums, protocols, generics, closures, error handling, ARC, async/await, actors and data-race safety, with SwiftUI basics.
What you'll learn
- Explain Swift's goals, tools and basic syntax, and build packages with SwiftPM.
- Handle optionals, control flow and collections safely and idiomatically.
- Model data with structs, enums with associated values and classes, choosing value or reference semantics.
- Write functions, closures and error handling, and design with protocols, extensions and generics.
- Manage memory with ARC, use access control and recognise property wrappers, result builders and macros.
- Write concurrent code with async/await, actors and Sendable, and test it with Swift Testing.
Syllabus
Getting Started with Swift
- What Swift Is and Where It Runs
- Xcode, Playgrounds and the Swift Package Manager
- Constants, Variables, Types and Strings
Optionals, Control Flow and Collections
Structs, Enums and Classes
Functions, Closures and Errors
Protocols, Extensions and Generics
- Protocols and Extensions
- Generics, Associated Types, some and any
- Codable, Equatable, Hashable and Comparable
Memory, Access Control and Language Features
Concurrency
- async/await and Structured Concurrency
- Actors, MainActor, Sendable and Swift 6 Data-Race Safety
- Cancellation and AsyncSequence