Swift Fundamentals
Swift is a compiled, type-safe programming language used for Apple-platform apps, server software, command-line tools, and other systems. Its syntax makes missing values, errors, and mutable state explicit so the compiler can catch many mistakes before a program runs.
itProgramming languages | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Swift Fundamentals
Swift is the language in which the compiler insists that a program state its intentions out loud. Before the program gets to run, it checks types, initialization, memory access, and much of the concurrency story. This is less mystical than it sounds. It is a very diligent colleague who cannot be bribed with a confident-looking comment.
A package is the outer container for that conversation. It names products and targets, and targets commonly become modules that hold source files and declarations. Swift Package Manager reads Package.swift, resolves dependencies, builds the graph, and runs tests. This matters because a program is not a pile of files with excellent intentions. It is a set of modules that must agree about names and dependencies.
Inside those modules, a binding makes mutation visible. let means the name does not change. var means it can. An optional makes absence visible too: it contains a value or nil, and code has to handle that fork before using the value. A throwing function tells a different story: something failed, the caller can inspect why, and recovery may be possible. The surprise is that these are not interchangeable escape hatches. Each records a different contract, which is why the compiler can help instead of merely looking concerned.
The same habit reaches memory and concurrency. Structures and enumerations carry independent values; classes carry shared identity. ARC keeps class instances alive while strong references exist, so a closure that keeps an instance alive can make a tidy little loop with no exit. Actors isolate mutable state, but await is a pause button, not a vault door. State can change while the task is away buying groceries from the scheduler.
Read the Intro for the full map from packages to actors and for the limits that remain after the checks pass. Use Slides when the relationships need to fit in one view. Keep the Cheatsheet nearby while choosing between optionals, errors, value semantics, reference semantics, and concurrency tools. Then take the practice reference and exercise to make swift build and swift test prove that the contracts survive contact with actual input.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.swift.org/
Supports
- Swift project identity, supported uses, installation, documentation, packages, and community entry points
- The course official URL and primary-source starting point
- https://www.swift.org/about/
Supports
- Compiler, standard library, LLDB, package manager, open source governance, platforms, and Objective-C interoperability
- Open source publication date and components for the timeline
- https://www.swift.org/documentation/tspl/
Supports
- The Swift Programming Language as the authoritative guided tour, language guide, and formal reference
- The reference-path rationale for detailed language behavior
- https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html
Supports
- Constants, variables, type inference, conversions, optionals, nil, memory safety, errors, assertions, and preconditions
- Quiz answers about let bindings, optionals, and failure contracts
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/classesandstructures/
Supports
- Structures as value types, classes as reference types, identity, assignment, and member behavior
- The value-type quiz answer and comparison tables
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/collectiontypes/
Supports
- Array, Set, and Dictionary ordering, uniqueness, typing, mutability, and lookup behavior
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/closures/
Supports
- Closures as function values, expression syntax, capture behavior, escaping closures, and collection transformations
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/controlflow/
Supports
- If, guard, loops, exhaustive switch statements, ranges, and pattern matching
- The exhaustive-switch quiz answer
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/enumerations/
Supports
- Enumeration cases, associated values, raw values, and recursive enumerations
- State-modeling examples in the course
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/errorhandling/
Supports
- Throwing, propagating, catching, and converting recoverable errors
- Quiz distinction between optionals and throwing functions
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/protocols/
Supports
- Protocol requirements, adoption, conformance, extensions, and protocol-oriented capability modeling
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/generics/
Supports
- Generic functions and types, constraints, associated types, and where clauses
- The generic-constraint quiz answer
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/automaticreferencecounting/
Supports
- Automatic Reference Counting, strong cycles, weak references, unowned references, and closure capture cycles
- ARC and weak-reference quiz claims
- https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html
Supports
- Async functions, await, tasks, task groups, actors, isolation, Sendable, MainActor, suspension, and data-race safety
- Both hero-tier concurrency quiz answers
- https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/
Supports
- Packages, products, targets, builds, tests, documentation, dependencies, and continuous integration
- Course package architecture and Swift Package Manager reference rationale
- https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/resolvingdependencyfailures/
Supports
- Recursive dependency resolution, constraints, conflict errors, Package.resolved, and dependency inspection
- The Package.resolved quiz answer
- https://www.swift.org/documentation/api-design-guidelines/
Supports
- Official naming, call-site clarity, terminology, and API design conventions
- The API design reference rationale
- https://www.swift.org/documentation/server/
Supports
- Server use cases, ecosystem guides, supported packages, deployment, and workgroup guidance
- Swift on Server reference and Vapor ecosystem placement
- https://www.swift.org/swift-evolution/
Supports
- Community proposal, review, acceptance, implementation, and release process for language changes
- The advanced reference-path rationale
- https://github.com/sindresorhus/awesome
Supports
- Discovery of Awesome Swift in the programming-language lists
- https://github.com/matteocrippa/awesome-swift
Supports
- Curated inclusion of SwiftLint, SwiftFormat, Alamofire, Vapor, Nimble, and Quick
- Ecosystem categories used to select high-signal learner resources
- https://realm.github.io/SwiftLint/
Supports
- SwiftLint rule, configuration, analysis, and integration documentation
- The SwiftLint awesome-link rationale
- https://github.com/nicklockwood/SwiftFormat
Supports
- Command-line, Xcode extension, cross-platform, configuration, and SwiftPM plugin formatting workflows
- The SwiftFormat awesome-link rationale
- https://alamofire.github.io/Alamofire/
Supports
- Typed HTTP requests, responses, validation, serialization, authentication, and concurrency APIs
- The Alamofire awesome-link rationale
- https://docs.vapor.codes/
Supports
- Vapor routing, content, databases, testing, deployment, async APIs, and SwiftPM setup
- The Vapor awesome-link rationale
- https://quick.readthedocs.io/en/latest/Externals/Nimble/README/
Supports
- Typed expectations, built-in and custom matchers, and asynchronous expectation behavior
- The Nimble awesome-link rationale
- https://developer.apple.com/xcode/
Supports
- Xcode editing, building, debugging, testing, profiling, simulator, and Apple SDK integration
- Xcode landscape placement
- https://www.swift.org/documentation/articles/getting-started-with-vscode-swift.html
Supports
- Visual Studio Code extension setup, SourceKit-LSP language features, building, running, and testing Swift packages
- Visual Studio Code landscape placement
- https://swiftpackageindex.com/
Supports
- Search, compatibility metadata, builds, documentation, and discovery for Swift packages
- Swift Package Index landscape placement
- https://docs.bitrise.io/en/getting-started/getting-started-with-ios-apps.html
Supports
- Hosted iOS project setup, builds, tests, signing, artifacts, and workflow automation
- Bitrise landscape placement for Swift projects
- https://docs.codemagic.io/yaml-quick-start/building-a-native-ios-app/
Supports
- Native iOS CI configuration, Xcode builds, testing, signing, and publishing preparation
- Codemagic landscape placement for Swift projects
- https://docs.github.com/en/actions/tutorials/build-and-test-code/swift
Supports
- GitHub Actions workflow setup for building and testing Swift packages
- GitHub Actions landscape placement
- https://developer.apple.com/swift/get-started/
Supports
- Swift announcement at WWDC 2014, design goals, Apple-platform role, and open source transition
- The 2014 introduction timeline event
- https://www.swift.org/blog/welcome/
Supports
- December 2015 open source launch, Swift.org, Linux port, core libraries, and new package manager
- The open source timeline event
- https://www.swift.org/blog/swift-3-0-released/
Supports
- September 2016 Swift 3 release, source changes, Linux progress, core libraries, and official package manager availability
- The Swift 3 timeline event
- https://www.swift.org/blog/swift-4-0-released/
Supports
- September 2017 Swift 4 release, Swift 3 source compatibility, standard-library changes, and archival and serialization support
- The Swift 4 timeline event
- https://www.swift.org/blog/abi-stability-and-apple/
Supports
- Swift 5 ABI stability on Apple platforms and its effects on runtime distribution and future evolution
- The ABI stability timeline event
- https://www.swift.org/blog/swift-on-windows/
Supports
- September 2020 downloadable Swift toolchain images for Windows and initial platform support
- The Windows timeline event
- https://www.swift.org/blog/swift-5.5-released/
Supports
- September 2021 async and await, structured concurrency, actors, and related evolution proposals
- The concurrency timeline event
- https://www.swift.org/blog/swift-5.9-released/
Supports
- September 2023 macros, noncopyable types, ownership features, and expanded SwiftSyntax documentation
- The macros timeline event
- https://www.swift.org/blog/announcing-swift-6/
Supports
- September 2024 Swift 6 release, language mode, data-race safety, platform expansion, Foundation, and Swift Testing
- The Swift 6 timeline event
- https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/runtimebehavior/
Supports
- Swift concurrency migration behavior, task-group concurrency limits, and structured concurrency operational considerations
- Field Notes guidance that concurrency diagnostics expose architectural boundaries rather than annotation chores
- https://forums.swift.org/t/actors-101/73872
Supports
- Actor reentrancy, suspension-point assumptions, cache state, and the need to restore invariants before await
- Field Notes guidance that actor isolation does not make a multi-step operation transactional
