Swift is Apple's general-purpose, compiled language for iOS, macOS and its other platforms, announced at WWDC on June 2, 2014. It began in July 2010 as a personal project of Chris Lattner, the creator of LLVM, before becoming a major effort inside Apple's developer tools group. Asking why Apple replaced Objective-C with Swift is really asking how a company with three decades of Objective-C code decided that the language underneath its platforms had reached its limits.
Why Apple replaced Objective-C with Swift
Objective-C dates back to the early 1980s and came to Apple through NeXT. It is a thin object-oriented layer on top of C, which made it powerful but also brought C's problems: manual pointer handling, undefined behavior, header files and verbose syntax. Apple had modernized it with features like blocks and automatic reference counting (ARC), but it could not remove the unsafe C core without breaking the language.
Swift was designed to keep what worked, including the Cocoa frameworks, ARC memory management and dynamic interop with Objective-C, while making common bugs impossible or obvious. Variables must be initialized before use, arrays check their bounds, integer overflow traps instead of wrapping silently, and optionals make the absence of a value explicit in the type system instead of relying on nil conventions. A modern, concise syntax also made Apple's platforms more approachable for new developers.
Design and key features
- Value types: structs and enums are first class, and the standard library's collections use copy-on-write.
- Protocol-oriented programming with protocol extensions and generics.
- Enums with associated values and exhaustive pattern matching in
switch. - Structured concurrency with
async/awaitand actors, introduced in Swift 5.5 in 2021. - Compilation through LLVM to fast native code, with Objective-C and, more recently, C++ interoperability.
A short Swift example
This snippet shows a struct, an enum, an optional and safe unwrapping with if let:
enum Platform {
case iOS, macOS, linux
}
struct App {
let name: String
let platform: Platform
var rating: Double?
}
let apps = [
App(name: "Notes", platform: .iOS, rating: 4.7),
App(name: "Server", platform: .linux, rating: nil),
App(name: "Editor", platform: .macOS, rating: nil)
]
for app in apps where app.platform != .linux {
if let rating = app.rating {
print("\(app.name): \(rating)")
} else {
print("\(app.name): not rated yet")
}
}
Where Swift is used
Swift is the main language for apps on iPhone, iPad, Mac, Apple Watch, Apple TV and Apple Vision Pro. SwiftUI, introduced in 2019, gave Apple platforms a declarative UI framework built around Swift features. Apple open-sourced Swift in December 2015 under the Apache 2 license, with support for Linux, and Windows support followed later. On the server, frameworks like Vapor and Hummingbird have active communities, and Apple has described using Swift for some of its own cloud services. Embedded Swift, a compilation mode for microcontrollers, extends the language to small devices.
Milestones
| Year | Milestone |
|---|---|
| 2010 | Chris Lattner begins work on the language |
| 2014 | Swift announced at WWDC; 1.0 ships in September |
| 2015 | Swift open-sourced, with Linux support |
| 2019 | Swift 5 brings ABI stability on Apple platforms; SwiftUI introduced |
| 2021 | Swift 5.5 adds async/await and actors |
| 2024 | Swift 6 introduces a language mode with compile-time data-race safety |
Limitations
Swift's early years were rough: Swift 2 and 3 introduced large source-breaking changes, and many teams spent weeks migrating. Compile times on big projects, especially with heavy type inference, remain a common complaint. The strict concurrency checking in Swift 6 is valuable but has made migration painful for some codebases. And while Swift runs on Linux and Windows, its ecosystem outside Apple platforms is much smaller than that of Go, Rust or Java.
Should you learn Swift?
If you want to build apps for Apple devices, Swift is the language to learn; new Apple frameworks are designed with Swift in mind first. It is also a well-designed language to study for its approach to safety, value types and protocols. Knowing why Apple replaced Objective-C with Swift explains its priorities: safety by default, performance close to C, and a smooth path for the huge amount of existing Apple code.
Frequently asked questions
Is Objective-C still used?
Yes, many older apps and parts of Apple's own frameworks are still written in Objective-C, and the two languages can be mixed in the same project. New Apple development, however, is overwhelmingly done in Swift.
Can Swift be used outside Apple platforms?
Swift is open source and runs on Linux and Windows, and it can be used for server-side applications and embedded systems. The ecosystem outside Apple devices is smaller, but it is actively maintained.
Who created Swift?
Chris Lattner started Swift in 2010 and led the project at Apple, working with a team of compiler engineers. Lattner left Apple in 2017, and the language continues under Apple and the open-source Swift project.







