Introduction to Swift programming
Swift is an open source general purpose programming language developed by Apple. While the primary goal of Swift was to replace Objective-C for the development of macOS and iOS applications, it has since gained popularity in other domains, such as the web frameworks.
This tutorial presents the most important notions of Swift. It is largely inspired by the Swift Programming Language Documentation.
All notions are introduced in a consistent order, and illustrated with a lot of examples that incrementally build a small Pokemon simulator.
All the code snippets can be copy/pasted into the Swift REPL.
Just run the swift
command in a terminal to get it.
- Chapter 1: Constants, Variables and Types
- Chapter 2: Control Flow
- Chapter 3: Functions and Closures
- Chapter 4: Properties and Methods
- Chapter 5: Initializers
- Chapter 6: Inheritance
- Chapter 7: Protocols, Extensions and Generics
This tutorial focuses on the Swift programming language.
It is not an introduction to iOS/macOS development,
and it won't even discuss the tools and libraries needed to build those.