ENES

Swift

Apple's programming language for building apps for iPhone, Mac and its other devices.

A Swift source file goes through a compiler and comes out as apps for an iPhone, a Mac and a watch

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

Go deeper

Related terms

More in Software