What is Swift?
What Swift is, where it's used, and why Apple built it to replace Objective-C.
2 min read
Swift is the programming language Apple introduced in 2014 for building apps across iOS, iPadOS, macOS, watchOS, and tvOS. It's the modern replacement for Objective-C — designed to be safer, faster to write, and far friendlier to read.
Beyond Apple's own platforms, Swift is open source and also runs on Linux and Windows, which makes it a real option for server-side code too. But its home turf, and the reason most people learn it, is building apps for iPhone and Mac.
Why Apple built a new language
Objective-C, Swift's predecessor, carries decades of C-era baggage: manual memory pitfalls, verbose syntax, and error-prone patterns like implicit type conversions. Swift was designed from scratch to fix those problems while staying fast enough for system-level work — it compiles to native machine code, not an interpreted bytecode.
// Objective-C-style verbosity is gone. This is a complete, valid Swift program:
print("Hello, Swift!")That one line runs top to bottom with no main() function, no imports for basic output, no semicolons required. Swift favors clarity over ceremony.
Safety is the core idea
The single idea that shapes more of Swift's design than any other is safety — catching whole categories of bugs at compile time instead of letting them crash your app in production. Two examples show up constantly:
// Swift won't let you accidentally mix types
let age: Int = 30
// let combined = age + "years" // Compile-time error, not a runtime surprise
// Swift forces you to handle the possibility of "no value"
var middleName: String? = nil
// print(middleName.count) // Won't compile — must unwrap firstThat second example points at Optional, arguably Swift's most distinctive feature, which gets its own section later in this course. The short version: instead of any value silently being allowed to be missing (as in many languages), Swift makes "this might not have a value" part of the type itself, so the compiler forces you to deal with it.
What you'll actually be doing
This course focuses on the Swift language — syntax, types, control flow, and the patterns idiomatic Swift code relies on. It doesn't teach SwiftUI or UIKit (Apple's UI frameworks) in depth, though the closing lesson introduces SwiftUI briefly, since it's the natural next step once you're comfortable with the language itself.
By the end, you'll be able to read real Swift code and understand not just what it does, but why it's written that way — which matters more in Swift than in most languages, since so much of its design is opinionated on purpose.