Swift
Apple's programming language for building apps for iPhone, Mac and its other devices.
Swift is a programming language created by Apple and announced in 2014. It is the main language for writing apps for iPhone, iPad, Mac, Apple Watch and Apple TV. It took over from Objective-C, an older language from the 1980s that Apple developers had used for years, with something shorter to write and harder to get wrong.
Swift is compiled: before the app ships, the compiler turns the code into machine instructions, which keeps apps fast. It is also strict on purpose. A value that might be missing has to be marked as an optional, and the compiler makes you handle the empty case, which removes a whole family of crashes. Most new Apple apps pair Swift with SwiftUI, Apple's framework for describing screens in code.
Swift has been open source since 2015 and also runs on Linux and Windows, so some teams use it on servers. In practice, though, learning Swift almost always means you want to build something for Apple's devices, and Xcode, Apple's editor, is where that work happens.
Keep in mind
- Swift is Apple's main language for iPhone, iPad, Mac, Watch and TV apps.
- It took over from Objective-C, Apple's older language.
- Optionals force you to handle missing values, which prevents many crashes.
- It is open source and runs elsewhere, but it is mostly used for Apple apps.