# Swift

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

- Level: Intermediate
- Topics: Software
- URL: https://tidbit.legios.com.ar/swift/
- In Spanish: [Swift](https://tidbit.legios.com.ar/es/swift/)

**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.

## An analogy

A house-brand tool kit. Apple designed it to fit its own furniture perfectly; you can take it to other jobs, but that furniture is where it shines.

## 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.

## Go deeper

- [Swift (official site)](https://www.swift.org/)
- [Swift on Apple Developer](https://developer.apple.com/swift/)
- [The Swift Programming Language (official book)](https://docs.swift.org/swift-book/)

## Related terms

- [Programming language](https://tidbit.legios.com.ar/programming-language/): A precise, written language people use to give instructions to a computer.
- [Apple](https://tidbit.legios.com.ar/apple/): The company that sells the iPhone and the Mac, plus the services that run on them.
- [Compiler](https://tidbit.legios.com.ar/compiler/): A program that translates source code into instructions a computer can run directly.
- [Framework](https://tidbit.legios.com.ar/framework/): A ready-made skeleton for an app: it sets the structure and calls your code.
- [Open source](https://tidbit.legios.com.ar/open-source/): Software whose code anyone can read, use, change and share.
- [Linux](https://tidbit.legios.com.ar/linux/): A free, open source operating system that runs most of the internet's servers.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
