Swift

Build for Apple and beyond

100% free · no signup to read 7 chapters Programming language

Created

2014 by Apple (Chris Lattner)

Type

Compiled, statically typed, safe

Runs on

iOS, macOS, watchOS, tvOS, Linux

Current version

Swift 5.10 (2024)

Powers

All Apple platform apps since 2014

Key feature

Optionals replace null

File extension

.swift

Best for

iOS/macOS apps, server-side Swift

What is Swift?

Swift is a modern programming language created by Apple in 2014 for iOS, macOS, watchOS, and tvOS development. It's also used for server-side development via Swift on Linux.

Why Swift?

Swift replaced Objective-C as Apple's primary language. It's safe (optionals prevent null crashes), fast (LLVM-compiled), and expressive (reads like natural language).

Feature Swift Objective-C Kotlin (Android)
Null safety Optionals Pointer-based Nullable types
Performance Excellent Excellent Excellent
Modern syntax Yes No (verbose) Yes
Apple platforms Primary Legacy Not supported
Server-side Growing (Vapor) No Spring/Ktor

What you'll learn

Chapter What you'll know
Introduction What Swift is, variables, types
Optionals Swift's solution to null
Structs Value types, protocols, extensions

Start with introduction.