Swift Tutorial
Learn Swift 6.3 from your first program to optionals, value types, protocols, generics, error handling, concurrency, actors and real projects. 146 lessons with Swift that compiles and runs in your browser, quizzes and projects.
Start learning →
of lessons completed
Getting Started
- Introduction to Swift Meet Swift, the safe, fast, modern language behind iPhone apps, servers and embedded chips. Learn its history, where it runs and what sets it apart.
- Your First Swift Program Write and run your first Swift program. Learn print, separators, comments, top-level code in main.swift and how the swiftc compiler builds your program.
- How Swift Works See how Swift source becomes a running program - the compiler pipeline, static typing, ARC memory management, value types, Foundation and SwiftPM.
- Constants and Variables Learn Swift constants and variables - let and var, type inference, annotations, naming rules, deferred initialization and shadowing, with real compiler errors.
- Basic Types A tour of Swift's basic types - Int and sized integers, Double, Float, Bool, Character and String, literals, type safety and why conversions are explicit.
- Working with Numbers Master Swift arithmetic - integer division, overflow traps and &+, rounding, Foundation math, Decimal for exact money, bit operations and number formatting.
- Strings Learn how Swift strings work - multiline and raw literals, Unicode and grapheme clusters, why indices are not integers, common methods and Substring, with runnable examples.
- String Interpolation and Formatting Build text with \(expression), custom interpolation, String(format:), padding, number and date formatting with formatted(), and the difference between description and debugDescription.
- Reading Input Learn how to read input in Swift with readLine, turn text into numbers with Int(_:) and Double(_:), handle nil and bad input, and write small interactive programs.
- Operators Learn every everyday Swift operator - arithmetic, remainder, comparison, logical, nil-coalescing, ternary, range and compound assignment - plus precedence and a preview of custom operators.
Control Flow
- if and else Learn how Swift's if, else if and else statements work, why conditions must be Bool, how to bind optionals with if let, and how to use if as an expression since Swift 5.9.
- switch Master Swift's switch statement and switch expressions - matching values, ranges, tuples, enums and optionals, value bindings, where clauses, fallthrough and compiler-checked exhaustiveness.
- Loops Learn Swift loops - for-in over ranges and collections, stride, while, repeat-while, enumerated(), zip, where clauses and the pitfalls that crash programs.
- break, continue and Labels Learn how Swift changes the flow of loops and switches - break, continue, labeled statements, fallthrough, return and defer - with runnable examples and real errors.
- guard and Early Exit Learn Swift guard statements - guard let, guard conditions, mandatory exits, binding scope and how guard flattens nested if-let pyramids with runnable examples.
- Optionals Understand Swift optionals from scratch - what nil means, if let and guard let unwrapping, nil coalescing, optional chaining, force unwrapping and why it crashes.
- Optionals in Depth Go beyond if let - transform optionals with map and flatMap, fill in defaults, handle double optionals, switch over optionals, understand implicitly unwrapped optionals and avoid pitfalls.
- Ranges Learn Swift ranges - closed ... and half-open ..< ranges, one-sided and partial ranges, ClosedRange and Range types, contains, clamped, slicing and iteration limits.
- Tuples Learn Swift tuples - create them, read elements by index or name, decompose into variables, return several values from a function, compare tuples and know when a struct is better.
- Pattern Matching Understand every kind of Swift pattern - wildcard, value binding, tuple, enum case, optional, type-casting and expression patterns - and use them in switch, if case, guard case and for case loops.
Functions and Closures
- Functions Learn to declare and call Swift functions - parameters, return values, implicit returns, Void, multiple results, throwing early, nested functions and the mistakes the compiler catches for you.
- Argument Labels and Parameter Names Understand Swift argument labels and parameter names, the underscore, default values, variadic parameters and inout, and learn how labels make function calls read like clear sentences.
- Function Types Learn that Swift functions are values with types - store them in variables, pass them as arguments, return them from other functions, and write your first higher-order functions.
- Closures Master Swift closures - closure expression syntax, type inference, shorthand argument names, trailing closures, capturing variables, reference semantics and when a closure may escape.
- Escaping Closures and Autoclosures Learn when Swift closures escape, why @escaping is required, how capture lists and [weak self] prevent reference cycles, and how @autoclosure delays evaluation in && and ??.
- map, filter, reduce and Friends Learn Swift higher-order functions - map, compactMap, flatMap, filter, reduce, sorted, forEach and contains(where:) - with step-by-step examples, pitfalls and performance advice.
- Generic Functions Learn Swift generic functions - type parameters, protocol constraints, where clauses, why swap and max are generic, specialization and common compiler errors, with runnable examples.
- Recursion Learn recursion in Swift - base case and recursive case, factorial, Fibonacci with memoization, Towers of Hanoi, permutations, tree walking, stack overflow and why tail calls are not guaranteed.
- Property Wrappers Learn Swift property wrappers - wrappedValue, projected values with $, wrapper initializers and arguments, a Clamped and Trimmed example, local use, limits and when a wrapper is the right tool.
- Result Builders Learn Swift result builders - @resultBuilder, buildBlock, buildOptional, buildEither and buildArray - and build a small HTML DSL step by step, with compiler errors and design advice.
- Type Aliases and the Never Type Learn Swift typealias for readable names and generic shortcuts, and the Never type for functions that do not return, impossible errors and uninhabited generics.
Collections
- Collections Overview A tour of Swift's three main collections - Array, Set and Dictionary - with let and var mutability, value semantics, copy-on-write and a guide to choosing the right one.
- Arrays Learn Swift arrays in depth - creating, indexing, appending, inserting, removing, slicing with ArraySlice, iterating, capacity, and the index-out-of-range trap and how to avoid it.
- Sorting and Searching Arrays Sort and search Swift arrays with sort, sorted, sorted(by:), keypath and multi-key ordering, firstIndex, binary search, partition and reversed - with costs and common mistakes.
- Sets Learn Swift Set - unique values, fast membership, insert and remove, union, intersection, subtracting, symmetric difference, subset tests, Hashable elements and custom types.
- Dictionaries Learn Swift dictionaries - creating, optional subscripts, default values, updating and removing, merging, keys and values views, iteration order, Hashable keys and duplicate-key traps.
- Dictionary Patterns Practical Swift dictionary recipes - counting with reduce(into:), grouping with Dictionary(grouping:by:), mapValues, inverting, nested dictionaries, lookup tables and memoization.
- Collection Protocols Learn Swift's Sequence, Collection, BidirectionalCollection and RandomAccessCollection protocols - iterators, indices, custom collections, slices and generic algorithms.
- Lazy Sequences Learn Swift lazy sequences - eager versus lazy evaluation, the lazy property, infinite sequences with sequence(first:next:) and stride, short-circuiting and the pitfalls of recomputation.
- Slices and Views Learn Swift slices and views - ArraySlice, Substring and Slice, preserved indices, copy-on-write, memory retention, String views, Dictionary Keys and Values, and how to avoid slicing mistakes.
- Collection Algorithms by Hand Build a stack, queue, ring-buffer deque and binary heap in Swift on top of Array, learn why removeFirst is slow, and see where swift-collections fits in. Runnable examples.
Structures, Classes and Enums
- Structures Learn Swift structures - stored and computed properties, memberwise initializers, methods, mutating, value semantics, let versus var instances, Equatable and when to choose a struct.
- Classes Learn Swift classes - reference semantics, initializers, shared mutable state, identity with ===, inheritance basics, deinit and ARC, and a clear guide to choosing a class or a struct.
- Properties Learn Swift properties - stored and computed, let vs var, lazy properties, willSet and didSet observers, type properties with static, and the real compiler errors you will meet along the way.
- Methods Learn Swift methods - instance methods, self, mutating methods on structs, type methods with static and class, method chaining, and the compiler errors that teach the rules.
- Initializers Learn Swift initializers - memberwise and custom init, default values, failable init?, designated and convenience initializers, required init and two-phase initialization with real errors.
- Memory Management with ARC Understand Swift ARC step by step - reference counts, deinit, strong, weak and unowned references, retain cycles, closure capture lists and how to detect leaks, with runnable examples.
- Inheritance Learn Swift class inheritance - subclassing, override, super, final, polymorphism and dynamic dispatch, overriding properties, and why composition and protocols are often a better choice.
- Access Control Learn Swift access control - private, fileprivate, internal, package, public and open, private(set), access in extensions, and how modules decide who can see your code, with real compiler errors.
- Enumerations Learn Swift enumerations - cases, exhaustive switch, raw values, associated values, CaseIterable, methods, mutating, static members and how enums make invalid states impossible.
- Indirect Enums and Recursive Types Learn Swift indirect enums - why recursive enums need indirect, how to build expression trees, linked lists and binary trees, evaluate them recursively, and how they are stored in memory.
- Subscripts Learn Swift subscripts - read-only and read-write access, multiple parameters, argument labels, static subscripts, generic subscripts, safe indexing and @dynamicMemberLookup.
- Optional Chaining in Depth Master Swift optional chaining - reading through nested optionals, calling methods and subscripts, assigning through a chain, short-circuiting, flattening results and when to unwrap instead.
- Type Casting Learn Swift type casting - checking types with is, safe downcasts with as?, forced as!, upcasting with as, Any and AnyObject, switch patterns, protocols and when to avoid casts.
- Nested Types and Extensions Learn Swift nested types and extensions - define types inside types, add computed properties, methods, initializers and protocol conformance to existing types, and organize code with extensions.
- Value vs. Reference Semantics Understand Swift value and reference semantics - copies versus shared instances, identity versus equality, copy-on-write, isKnownUniquelyReferenced, and how to choose struct, class or actor.
- Equatable, Hashable and Comparable Learn Swift's Equatable, Hashable and Comparable protocols - synthesized conformances, custom ==, hash(into:), sorting custom types, Set and dictionary keys, and the rules that keep them correct.
- Codable Learn Swift Codable - encode and decode JSON with JSONEncoder and JSONDecoder, rename keys with CodingKeys, handle optionals and dates, write custom init(from:), and read decoding errors.
- CustomStringConvertible and Debug Output Control how your Swift types print with CustomStringConvertible and CustomDebugStringConvertible, and inspect values with print, debugPrint, dump, String(reflecting:) and Mirror.
- Lazy Properties and Property Observers Learn Swift lazy properties and property observers in depth - when lazy runs, lazy in structs, thread safety, willSet and didSet order, oldValue, observers in init and subclasses.
- Extensions in Depth Master Swift extensions - add computed properties, methods, initializers, subscripts and nested types, adopt protocols, constrain with where clauses and know the limits.
Protocols and Generics
- Protocols Learn Swift protocols - declaring requirements, conforming with structs, classes and enums, protocols as types, mutating and static requirements, initializers, inheritance and default implementations.
- Protocol Extensions Master Swift protocol extensions - add default behavior, constrain extensions with where clauses, extend standard library protocols, and understand static versus dynamic dispatch and its surprises.
- Protocol Composition and Delegation Learn Swift protocol composition with &, the delegate pattern, weak delegates, class-bound protocols with AnyObject, retain cycles and optional delegate methods, with runnable examples.
- Associated Types Learn Swift associated types - associatedtype placeholders in protocols, inference, constraints, primary associated types like any Container<Int>, type erasure, and Sequence and Collection examples.
- Generics Learn Swift generics for types - generic structs, classes and enums, constraints, conditional extensions, where clauses, generic subscripts, specialization and performance, with runnable examples.
- Opaque and Existential Types Understand Swift some Protocol and any Protocol - opaque return types, existential boxes, differences, compiler errors, performance costs and when to choose each, with runnable examples.
- Generic Patterns Learn reusable Swift generic patterns - Result-like enums with map and flatMap, generic collections, protocols with Self requirements, phantom types and generic memoization, with runnable code.
- Conditional Conformance Learn Swift conditional conformance - how a generic type conforms to a protocol only when its parameters do, with Array, Optional, custom wrappers, Codable, Hashable and conflicts, with runnable code.
- Noncopyable Types Learn Swift noncopyable types: ~Copyable, ownership, consume, consuming and borrowing, deinit timing, take(), discard self and generics, with examples.
- Parameter Packs Learn Swift parameter packs and variadic generics: each and repeat, type packs, value packs, pack expansion, shape errors and constraints, with examples.
- Macros Learn Swift macros: freestanding and attached macros, built-in ones like #fileID, #warning, @Observable and #Predicate, and how custom macros are built.
Error Handling
- Error Handling Learn Swift error handling: the Error protocol, throws, throw, do-catch with patterns, try, try? and try!, propagation, rethrows and defer.
- Custom Errors Design Swift custom errors: enums with associated values, structs, LocalizedError messages, wrapping errors into layers and catch patterns with where clauses.
- Typed Throws Learn Swift 6 typed throws: throws(MyError), exhaustive catch without a catch-all, converting errors, generic throws(E), Never, rethrows and when to use it.
- The Result Type Learn how Swift's Result type stores a success value or an error, how to use map, flatMap, mapError and get(), and when to choose Result over throws.
- defer and Cleanup Learn how Swift's defer statement runs cleanup code when a scope exits, in what order several defers run, how it works with throw and return, and its limits.
- Assertions and Preconditions Learn when to use assert, precondition, fatalError and Never in Swift, how they differ in debug and release builds, and when a crash is better than a thrown error.
Concurrency
- Introduction to Swift Concurrency A beginner-friendly tour of Swift concurrency: why async/await replaced callbacks, what tasks are, how await suspends, and how Sendable prevents data races in Swift 6.
- async and await Learn how to write and call async functions in Swift, use try await, run work together with async let, add async properties and initializers, and avoid slow sequential awaits.
- Tasks Learn how Swift Tasks work: creating them, awaiting their value or result, priorities, detached tasks, actor inheritance, cooperative cancellation and Task.sleep.
- Task Groups Learn Swift task groups - withTaskGroup, addTask, collecting results in any order, withThrowingTaskGroup, cancelAll, limiting concurrency, discarding groups and the Swift 6 data-race rules.
- Actors Learn Swift actors - how they protect mutable state, actor isolation, why you need await, reentrancy bugs, nonisolated members, isolated parameters, global actors and @MainActor in main.swift.
- Sendable and Data Races Understand Swift's Sendable protocol - which types may cross between tasks and actors, @Sendable closures, sending parameters, @unchecked Sendable with Mutex, and the real Swift 6 data-race errors.
- AsyncSequence and AsyncStream Learn Swift AsyncSequence and AsyncStream - for await loops, writing your own async sequence, continuations, finishing and termination, buffering policies, throwing streams and merging streams.
- Cancellation and Timeouts Learn cooperative cancellation in Swift concurrency - Task.cancel, isCancelled, checkCancellation, CancellationError, propagation to child tasks, cleanup, cancellation handlers and a timeout helper.
- Bridging Callbacks to async Learn how to wrap callback-based and delegate-based APIs in async functions with withCheckedContinuation and withCheckedThrowingContinuation, the resume-once rule, cancellation and AsyncStream bridges.
- Threads and Dispatch Learn Swift threads and Grand Central Dispatch - Thread, serial and concurrent DispatchQueue, DispatchGroup, semaphores, NSLock, and how they relate to async/await in Swift 6.
- Synchronization and Shared State Learn the Swift Synchronization module - Mutex, withLock, Atomic, compareExchange, memory ordering, and when to choose locks or atomics over actors, with real Swift 6 compiler errors.
- Combine Basics Learn Apple's Combine framework - publishers, subscribers, operators, subjects, @Published and cancellation - with runnable stand-ins you can try anywhere, plus how Combine compares to async/await.
Standard Library and Foundation
- Text Processing Learn practical Swift text processing - split, components, trimming, searching and replacing, lines, words and Character properties, with a word-frequency program and the pitfalls of Unicode.
- Regular Expressions Learn Swift regular expressions - regex literals, matches, captures with typed output, named groups, replacing, runtime Regex(String), and the readable RegexBuilder DSL, with real compiler errors.
- Dates and Times Learn Swift dates - Date, Calendar, DateComponents, DateFormatter, formatted(), ISO 8601, TimeZone, and Duration with ContinuousClock, plus the classic bugs with time zones and daylight saving.
- Timers: Repeating, One-Shot and Task-Based Learn every way to run code later or repeatedly in Swift - Timer with run loops, DispatchSourceTimer, Task.sleep and clocks - with runnable examples, tolerance, cancellation and a timeout helper.
- Number and Measurement Formatting Learn to format numbers in Swift - formatted() styles, NumberFormatter, currency, percent, compact notation, Measurement and units, ByteCountFormatter and Locale, with parsing pitfalls.
- Files and Directories Read and write files in Swift with URL, FileManager and FileHandle - temp directories, listing folders, copying, moving, deleting, partial reads, CSV parsing and CocoaError handling.
- Data and Bytes Work with raw bytes in Swift - the Data type, UInt8 arrays, UTF-8, Base64 and hex encoding, endianness, bit operations, safe unsafe-pointer access and a small binary packet format.
- Working with JSON Encode and decode JSON in Swift with Codable, JSONEncoder and JSONDecoder - output formatting, key and date strategies, CodingKeys, DecodingError paths, JSONSerialization and a JSONValue enum.
- Random Numbers Generate random values in Swift - Int.random, randomElement, shuffled, SystemRandomNumberGenerator, and your own seeded RandomNumberGenerator for reproducible tests, simulations and games.
- UUID, URL and URLComponents Create UUIDs and parse, build and encode URLs in Swift - URL parts, relative URLs, URLComponents, URLQueryItem, percent-encoding, the plus-sign trap and safe construction of web addresses.
- Processes and Environment Learn how a Swift program talks to its surroundings - command-line arguments, environment variables, ProcessInfo, exit codes, stderr, and running other programs with Process and Pipe.
- Networking with URLSession Learn URLSession in Swift: URLRequest, async data(for:), status codes, JSON decoding, errors, cancellation and testing with a URLProtocol stub that runs here.
- Printing and Debugging Learn Swift debugging output: print options, debugPrint, dump, custom descriptions, #fileID and #line, assert versus fatalError, and where os.Logger fits.
- Sort Details Go beyond sort() in Swift: stability, comparator rules, multi-key sorts, KeyPathComparator, SortComparator, string ordering and the cost of expensive sort keys.
- Key Paths Learn Swift key paths: KeyPath and WritableKeyPath, key paths as functions in map and sorted, appending paths, @dynamicMemberLookup and generic helpers.
- Bitwise and Overflow Operators Learn Swift bitwise operators, shifts, masks and flags, bit counting, two's complement, wrapping &+ &- &* operators, truncatingIfNeeded, OptionSet and a small FNV hash.
- Characters, Unicode and Grapheme Clusters Go inside Swift strings - Character vs Unicode scalar vs UTF-8 and UTF-16 views, grapheme clusters, canonical equivalence, emoji sequences and decoding bytes safely.
Advanced Swift
- Memory Layout Understand how Swift stores values: MemoryLayout size, stride and alignment, struct padding, optionals and enums, class references and raw bytes.
- Unsafe Swift Learn when to use Swift's unsafe pointers: UnsafeMutablePointer, buffer pointers, withUnsafe closures, the memory life cycle, calling C and Span as the safe option.
- Interoperating with C Call C libraries from Swift: how C types map to Swift, C strings, pointers, errno, structs, callbacks with @convention(c), and the pitfalls that crash programs.
- Dynamic Features Learn Swift's dynamic features: callAsFunction, @dynamicMemberLookup, @dynamicCallable and Mirror reflection, with runnable examples, pitfalls and design advice.
- Functional Techniques Practical functional programming in Swift: pure functions, immutability, composition, currying, map and flatMap on Optional, Array and Result, memoization and pitfalls.
- Designing Good APIs Design Swift APIs that read clearly at the call site: naming rules, argument labels, mutating pairs, strong types, error design, deprecation and a review checklist.
- Documentation Comments Write Swift documentation comments that tools understand: /// and /** */ syntax, Parameters, Returns, Throws, callouts, symbol links, DocC, and #warning markers.
- Swift Language Versions and Evolution Understand Swift releases from 5.0 to 6.3: toolchain versus language mode, Swift 6 data-race safety, upcoming features, version checks and the evolution process.
- Performance Tips Write fast Swift: value types and copy-on-write, reserving capacity, generics versus existentials, inlining and @inlinable, lazy sequences, strings, and how to measure.
- Design Patterns in Swift Learn the classic design patterns the Swift way - singleton, factory, builder, strategy, delegate, observer and adapter - with protocols, value types and closures, and runnable examples.
- Testing in Swift Learn to test Swift code with the Swift Testing framework (@Test, #expect, #require), XCTest, parameterized tests, async tests and a tiny harness you can run here.
- Swift Package Manager Learn how Swift Package Manager works: Package.swift, targets, products, dependencies and version rules, tests and commands, with runnable models of its core ideas.
- Profiling with Instruments and Benchmarking Find real Swift bottlenecks with Instruments: Time Profiler, Allocations, signposts and points of interest, plus how to write fair micro-benchmarks with ContinuousClock.
Platforms and Ecosystem
- Swift on Apple Platforms A tour of building apps in Swift for iPhone, iPad, Mac, Watch, TV and Vision Pro: Xcode, SwiftUI, UIKit and AppKit, portable code, conditional compilation, shipping.
- SwiftUI Overview Understand SwiftUI before you open Xcode: declarative views, state and bindings, modifiers and their order, @Observable models, layout, and a minimal app, with runnable models.
- Swift on the Server Learn how Swift runs backend services on Linux: HTTP basics, routing and middleware, async handlers, actors for shared state, Codable JSON, Vapor, Hummingbird and SwiftNIO.
- Swift on Linux and Windows Learn how Swift runs on Linux and Windows - what is the same, what differs, conditional compilation, the C library, Foundation, static Linux executables and Docker. Includes runnable portability examples.
- Embedded Swift Learn what Embedded Swift is, how it differs from regular Swift, what it leaves out, and how to design firmware-style code with generics, typed throws and fixed-size storage. Runnable simulations included.
- SwiftData and Persistence Overview Compare Swift persistence options and learn SwiftData - @Model, ModelContainer, ModelContext, @Query, relationships and migration - with runnable Predicate and context stand-ins and Core Data notes.
- Observation and @Observable Learn the Swift Observation framework - the @Observable macro, per-property tracking, withObservationTracking, @ObservationIgnored, computed and nested models, Observations streams and SwiftUI use.
- SwiftUI State, Bindings and Layout Go deeper into SwiftUI - which property wrapper to use, bindings, the layout size negotiation, stacks, frames, grids and NavigationStack - with runnable layout and navigation stand-ins.
- Swift Testing: @Test, #expect and Traits Learn the Swift Testing framework in depth - suites and their lifecycle, parameterized tests, traits and tags, expecting errors, confirmations and known issues, all running for real.
- App Architecture: MVC, MVVM and Clean Boundaries Structure a real Swift app - MVC, MVVM, view models with Observation, repository protocols, dependency injection and a composition root, with runnable console examples.
- Security: Keychain, CryptoKit and Safe Parsing Learn secure habits in Swift - storing secrets in the Keychain, hashing and encryption with CryptoKit, constant-time comparison, and parsing untrusted input safely.
- SwiftLint, swift-format and DocC Set up Swift style and documentation tooling: SwiftLint rules and config, swift-format and its JSON settings, DocC catalogs and hosting, plus CI and SwiftPM integration.
Projects
- Project: Expression Calculator Build a calculator in Swift from scratch: a tokenizer, a recursive descent parser, an indirect enum syntax tree, an evaluator and typed errors. Complete program, runs in your browser.
- Project: Command-Line To-Do Manager Build a to-do manager in Swift with structs, enums, typed errors, a command parser and Codable JSON persistence behind a storage protocol. A complete program that runs in your browser.
- Project: Bank Account Simulation Build a bank simulation in Swift with actors, typed errors, async transfers with rollback, an audit ledger and protocol-based fee policies. Learn actor reentrancy by example, in your browser.
- Project: Inventory and Reports Build an inventory system in Swift that imports CSV data, groups and sorts with dictionaries, prints aligned report tables and exports JSON with Codable. Full program, runs in your browser.
- Project: A Text Adventure Engine Build a complete text adventure in Swift step by step - enums for directions and commands, a command parser, a game state struct, locked doors, and a scripted playthrough from stdin.
- Project: An Async Pipeline Build a concurrent processing pipeline in Swift 6 - AsyncStream sources, task groups with bounded concurrency, per-job timeouts, cancellation, an actor for aggregation, and deterministic output.
- Project: A JSON Parser Build a JSON parser in Swift from scratch - an enum for JSON values, a recursive descent parser with typed throws, line and column errors, a pretty printer, path queries and round-trip tests.
- Project: Appointment Scheduler Build a doctor appointment scheduler in Swift with Date and Calendar, overlap detection, typed booking errors, free-slot search and Codable JSON saving. A full program that runs in your browser.
Practice
- Swift Cheat Sheet A compact Swift 6 cheat sheet with runnable examples - variables, strings, optionals, collections, closures, types, protocols, errors, concurrency, access control and common conventions.
- Common Swift Mistakes The Swift mistakes beginners and professionals make - force unwraps, index traps, retain cycles, value semantics surprises and Swift 6 concurrency errors - with the real compiler messages and fixes.
- Swift for Developers from Other Languages A practical guide to Swift for developers who already know Java, Kotlin, C#, Python or JavaScript - concept map, key differences in nullability, value types, errors and concurrency, with runnable code.
- Swift Interview Questions Prepare for a Swift interview with 40 questions and clear answers on optionals, value types, protocols, generics, ARC, error handling and concurrency, with runnable code.
- Practice Problems: Algorithms in Swift Twelve interview-style algorithm exercises in Swift with hints, full solutions and complexity notes: arrays, strings, hashing, two pointers, recursion, sorting and grids.
- Practice Problems: Protocols and Generics Ten Swift exercises on protocols, extensions, generics, associated types, conditional conformance and opaque types, each with a hint and a runnable, explained solution.