Appendices: Projects, Interview Questions, Cheat Sheet & Study Plan
Capstone projects, interview questions, a Swift cheat sheet, Swift for developers coming from other languages, and resources with a study plan.
Appendix A: Capstone Projects
Beginner: Command-Line Quiz Game. Structs, enums, arrays, dictionaries, readLine, scoring, JSON-loaded questions via Codable (SwiftPM executable).
Beginner: Unit Converter Library + CLI. Protocols, generics, Measurement, swift-argument-parser, Swift Testing suite.
Intermediate: Expense Tracker (SwiftUI + SwiftData). CRUD, charts (Swift Charts), filtering with #Predicate, categories as relationships, export to CSV.
Intermediate: Weather App. URLSession + async/await, Codable models, @Observable view model, error/loading states, location (CoreLocation via AsyncStream), caching with an actor.
Intermediate: Markdown Notes for macOS/iPadOS. NavigationSplitView, AttributedString Markdown rendering, iCloud sync (CloudKit), keyboard shortcuts.
Advanced: Concurrent Image Downloader. Task groups with limited concurrency, an actor-based cache with request de-duplication, cancellation, progress via AsyncStream, Swift 6 strict mode with zero warnings.
Advanced: Custom Macro Package. A @CodingKeys, @AutoInit, or #URL macro with SwiftSyntax, expansion tests, DocC docs, published to the Swift Package Index.
Advanced: Result Builder DSL. An HTML/SQL/Layout DSL using @resultBuilder, with conditionals and loops, plus a tested renderer.
Advanced: REST API with Vapor or Hummingbird. PostgreSQL via Fluent/PostgresNIO, JWT auth, OpenAPI-generated interface, Swift Testing, Docker with the static Linux SDK.
Advanced: Full-Stack Swift. An iOS SwiftUI client + a Vapor backend sharing a Swift package of models (Codable DTOs), with deployment.
Systems: C/C++ Interop Wrapper. Wrap a C library (SQLite, zlib) or a C++ library with an idiomatic Swift API (noncopyable resource types, Span).
Embedded/Wasm: Microcontroller or Browser Project. An Embedded Swift sensor reader on a Raspberry Pi Pico/ESP32, or a Swift Wasm web app with JavaScriptKit.
Appendix B: Interview Questions
What's the difference between let and var?
What are optionals? List five ways to unwrap them.
if let vs guard let: when do you use each?
Value types vs reference types: give examples and explain copy-on-write.
Struct vs class vs enum vs actor: when do you use each?
Why are strings not integer-indexed in Swift?
What is type inference? What is a tuple?
Explain switch exhaustiveness and pattern matching with where.
What's the difference between Array, Set, and Dictionary?
What do map, compactMap, flatMap, filter, and reduce do?
Functions, Closures and Types What are argument labels and parameter names?
Explain inout parameters.
What are escaping vs non-escaping closures? What is @autoclosure?
What are capture lists, and why use [weak self]?
Enums with associated values vs raw values?
Explain computed properties, lazy properties, and property observers.
What are property wrappers? Give examples from SwiftUI.
Explain designated vs convenience initializers and two-phase initialization.
What are failable initializers?
Explain throws, typed throws, rethrows, try?, try!, Result, and defer.
Protocols and Generics What is protocol-oriented programming?
Protocol requirements vs protocol extension methods: how does dispatch differ?
What are associated types and primary associated types?
Explain conditional conformance.
some vs any: what's the difference and when do you use each?
What are generics constraints and where clauses?
What are parameter packs?
Explain the access levels, including open vs public and package.
Memory and Advanced How does ARC work? What causes retain cycles?
weak vs unowned: when do you use each?
What are noncopyable types (~Copyable)? What do borrowing and consuming mean?
What are result builders? How does SwiftUI use them?
What are key paths? Give practical uses.
What are macros? What are freestanding vs attached macros?
What is the exclusivity enforcement rule?
Explain async/await and suspension points.
What is structured concurrency? async let vs TaskGroup vs Task vs Task.detached?
How does task cancellation work?
What are actors? What is actor reentrancy?
What is @MainActor? What are global actors?
What is Sendable? What does the Swift 6 language mode change?
How do you bridge completion handlers and delegates to async/await?
What's new with approachable concurrency in Swift 6.2 (@concurrent, nonisolated(nonsending))?
Apps and Tooling Explain SwiftUI's data flow (@State, @Binding, @Observable, @Environment, @Bindable).
How does SwiftUI decide when to re-render views?
SwiftData vs Core Data?
How do you integrate UIKit with SwiftUI?
How do you structure a Swift package with multiple targets and tests?
Swift Testing vs XCTest?
How do you find and fix memory leaks and performance issues?
Implement a generic Stack<T> and Queue<T> conforming to Sequence.
Write a function that groups words by their first letter using Dictionary(grouping:by:).
Model a network state with an enum and render each state in SwiftUI.
Implement an actor-based rate limiter or cache with request de-duplication.
Bridge a callback-based API to async/await with a continuation.
Write a property wrapper that trims and lowercases strings.
Fetch three URLs concurrently with a task group and return the results in order.
Write a @resultBuilder that builds an array of strings with if and for support.
Appendix C: Swift Cheat Sheet
// ===== Basics =====
let constant = 10; var variable = "text"; let typed: Double = 3.14
let interp = "Value: \(constant)"; let multi = """
lines
"""
let opt: Int? = Int("42"); let v = opt ?? 0
if let opt { print(opt) }; guard let opt else { return }
// ===== Collections =====
var arr = [1, 2, 3]; arr.append(4); arr.map { $0 * 2 }; arr.filter { $0 > 1 }; arr.reduce(0, +)
var dict = ["a": 1]; dict["b"] = 2; dict["c", default: 0] += 1
let set: Set = [1, 2]; let tuple = (x: 1, y: 2)
// ===== Control flow =====
for i in 0..<5 { }; for (i, e) in arr.enumerated() { }; while cond { }; repeat { } while cond
switch x { case 0: break; case 1...9: break; case let n where n < 0: break; default: break }
let label = if x > 0 { "pos" } else { "neg" }
// ===== Functions & closures =====
func greet(_ name: String, times: Int = 1) -> String { String(repeating: "Hi \(name) ", count: times) }
func swap(_ a: inout Int, _ b: inout Int) { (a, b) = (b, a) }
let square: (Int) -> Int = { $0 * $0 }
arr.sorted { $0 > $1 }
// ===== Types =====
struct Point: Hashable, Codable { var x, y: Double; mutating func move() { x += 1 } }
final class Person { let name: String; init(name: String) { self.name = nam
…swift run | swift build -c release | swift test | swift package init --type executable | swift format -i -r .Appendix D: Swift for Other Developers
string | null struct (+ Equatable/Hashable) sealed class enum with associated values { x -> x * 2 } lambda x: x * 2 coroutines suspend CompletableFuture/virtual threads async/await + actors GC (refcount + GC) Key gotchas:
Kotlin devs: Swift structs are value types (copied), unlike Kotlin data classes, and there's no GC, so you need to watch retain cycles.
Java/C# devs: protocols + extensions replace much of what abstract base classes do, and enums are far more powerful (associated values).
Python/JS devs: Swift is statically typed and compiled. Optionals must be unwrapped, and integer overflow traps instead of wrapping silently.
Appendix E: Resources and Study Plan
swift.org (downloads, docs, blog, forums), *The Swift Programming Language* book (docs.swift.org), Swift Evolution (proposals), developer.apple.com (SwiftUI tutorials, Human Interface Guidelines, WWDC videos), the Swift API Design Guidelines, the Swift Package Index
Hacking with Swift (Paul Hudson): 100 Days of Swift/SwiftUI, Swift Concurrency by Example
Stanford CS193p (Developing Apps for iOS, free lectures)
Point-Free (advanced Swift and TCA), Swift by Sundell, SwiftLee, objc.io books (*Advanced Swift*, *Thinking in SwiftUI*), Kodeco (formerly raywenderlich.com)
Apple's Develop in Swift and Swift Playgrounds, Exercism Swift track
Books: *Swift Programming: The Big Nerd Ranch Guide*, *iOS Programming: The Big Nerd Ranch Guide*, *Practical Swift Concurrency* (Donny Wals), *Swift Concurrency by Tutorials*
Swift Forums, iOS Dev Weekly, Swift Weekly Brief, r/swift, the Swift Discord/Slack, conferences (WWDC, try! Swift, Swift Heroes, ServerSide.swift, NSSpain, iOSDevUK) 13-Week Study Plan Setup, basics, types, operators
Strings, optionals, control flow, collections Functions, closures, enums
Structs/classes, properties, methods, inheritance, initialization Errors, casting, extensions
Protocols, stdlib protocols, generics, some/any, packs, access control
ARC, ownership, operators, result builders, key paths Macros, pattern matching, memory safety
Concurrency: async/await, tasks, actors, Sendable, streams, synchronization
Codable, Foundation, networking, regex, collections in depth
SwiftPM, testing, debugging, DocC, interop SwiftUI, data flow, persistence, UIKit, Combine 54–57 + Capstone
Server-side, cross-platform, distribution/performance/security, evolution and best practices
Final tip: Write Swift every day in a Playground, read the official *Swift Programming Language* book alongside this course, embrace value types, protocols, and optionals, and adopt Swift Concurrency with the Swift 6 language mode early. Then ship a real app with SwiftUI. Happy coding! 🐦