Swift
Swift is a programming language that Apple introduced in 2014. It is used to write most apps for iPhone, iPad, Mac, and Apple Watch.
Swift is a programming language. That is a defined way of writing instructions that humans give to a computer. In the end, the computer only understands numbers, so a helper program translates the written text into these numbers. Swift was developed by Apple and publicly introduced in 2014. It is used primarily to build apps for iPhone, iPad, Mac, and Apple Watch. The name is a statement of intent: Swift means fast in English, and Apple marketed the language from the very beginning with an emphasis on high speed.
Why Apple needed its own language
Before Swift, Apple apps were written in a language called Objective-C. It dates back to the early 1980s and is considered cumbersome. Its syntax is full of square brackets and long command names. But above all, it allowed errors that could cause an app to crash while running. Swift was meant to do the same things, but be more readable and safer.
Safer here mainly means: Swift catches certain errors already at compile time, not only once the user encounters them. A classic case is accessing a value that doesn’t actually exist. Swift forces developers to explicitly handle this case beforehand. As a result, such crashes became noticeably rarer.
Economically, the language is a control instrument for Apple. Anyone developing for Apple devices works with Apple’s tools and within Apple’s ecosystem. The App Store generates billions in revenue, and Swift lowers the barrier to publishing something there. Since 2015, however, Swift has been open source, meaning the source code of the language itself can be viewed. That’s why it also runs on servers with the Linux operating system.
How a Swift program comes into being
Developers mostly write Swift in Xcode, Apple’s free development environment. This is a program for writing, testing, and translating code. As you type, Xcode continuously checks whether something doesn’t fit together. Afterwards, a translator called a compiler turns the text into a finished program for the device’s processor.
A central principle of Swift is types. Every value in the program has a fixed kind: number, text, truth value. You cannot place text where a number is expected. Swift often guesses the kind itself from context, so the code still stays short. This is the difference from languages like Python, which only notice such mix-ups at runtime.
For an app’s interface there is SwiftUI, an extension introduced in 2019. With it, you describe how a screen should look instead of placing buttons step by step. If a value in the program changes, the interface redraws itself automatically. A common misconception is that SwiftUI is its own language. It is a collection of ready-made building blocks, written in Swift.
Swift on the iPhone and in tech news
Practically every app you open on an iPhone contains Swift code. That’s true for big names like Airbnb or LinkedIn just as much as for small tools. Apple’s own apps too, such as Music or Weather, are partly written in Swift. Anyone who wants to try the language themselves can find Swift Playgrounds, a free app for getting started.
Swift regularly appears in the news around the WWDC developer conference, which Apple holds every June. There, new versions of the language and new building blocks are introduced. One topic of recent years is on-device machine learning: Apple provides tools that let apps run trained AI models directly on the iPhone, without sending data to a server. These models are addressed from within Swift.
Important distinction: Swift has nothing to do with SWIFT in all capital letters. That is an international network for bank transfers and often appears on financial news sites in connection with sanctions. Same name, completely different thing.