ProgramGuru

Swift

Learn Swift. Build clear, reliable programs.

Follow school examples from your first program to typed records, protocols, files and concurrent work.

Choose your starting point

New to Swift? Start with Foundations. You can switch anytime.

Foundations

Examples are checked in Swift 6 language mode. Console programs teach the language; local files, packages and app frameworks need their stated environment.

Mallikarjuna Mallisetty, author
About the author

Mallikarjuna Mallisetty

General programming

Mallikarjuna shares practical programming tutorials and foundational concepts designed to help developers learn by building and experimenting.

View LinkedIn profile ↗

Your learning path

All lessons

41 lessons41 code examples46 quiz questions

Your progress is saved on this device.

Estimated time includes reading, exploring code and answering quizzes. Learn at your own pace.

Getting Started

3 lessons · 12 min
  1. What is Swift?1code examples1quiz questions4minutes estimated learning time
  2. Set up and run Swift1code examples1quiz questions4minutes estimated learning time
  3. Hello World and console output1code examples1quiz questions4minutes estimated learning time

Values and Types

6 lessons · 27 min
  1. Variables and constants1code examples1quiz questions4minutes estimated learning time
  2. Data types and safe conversion1code examples1quiz questions5minutes estimated learning time
  3. Arithmetic, comparisons and Boolean logic1code examples1quiz questions4minutes estimated learning time
  4. Strings, characters and interpolation1code examples1quiz questions4minutes estimated learning time
  5. Optionals: a value may be absent1code examples2quiz questions6minutes estimated learning time
  6. Optional binding and chaining1code examples1quiz questions4minutes estimated learning time

Control Flow

5 lessons · 20 min
  1. Choose a branch with if and else1code examples1quiz questions4minutes estimated learning time
  2. Match cases with switch1code examples1quiz questions4minutes estimated learning time
  3. Repeat work with for-in1code examples1quiz questions4minutes estimated learning time
  4. Repeat while a condition holds1code examples1quiz questions4minutes estimated learning time
  5. Exit early with guard1code examples1quiz questions4minutes estimated learning time

Collections

4 lessons · 16 min
  1. Arrays: keep an ordered list1code examples1quiz questions4minutes estimated learning time
  2. Dictionaries: look up a value by key1code examples1quiz questions4minutes estimated learning time
  3. Sets and tuples solve different jobs1code examples1quiz questions4minutes estimated learning time
  4. Transform collections with map, filter and reduce1code examples1quiz questions4minutes estimated learning time

Functions and Closures

3 lessons · 13 min
  1. Functions: name reusable work1code examples1quiz questions4minutes estimated learning time
  2. Argument labels, defaults and inout1code examples1quiz questions4minutes estimated learning time
  3. Closures: pass behaviour as a value1code examples1quiz questions5minutes estimated learning time

Modelling Data

11 lessons · 50 min
  1. Enums and associated values1code examples1quiz questions4minutes estimated learning time
  2. Structs and value semantics1code examples2quiz questions6minutes estimated learning time
  3. Classes and shared references1code examples2quiz questions6minutes estimated learning time
  4. Stored properties, computed properties and observers1code examples1quiz questions4minutes estimated learning time
  5. Initialization and valid starting state1code examples1quiz questions4minutes estimated learning time
  6. Inheritance, overrides and safe casting1code examples1quiz questions4minutes estimated learning time
  7. Protocols: define a capability1code examples1quiz questions4minutes estimated learning time
  8. Extensions and shared implementations1code examples1quiz questions4minutes estimated learning time
  9. Generics: reuse an algorithm while keeping types1code examples1quiz questions4minutes estimated learning time
  10. Access control and protected mutation1code examples1quiz questions5minutes estimated learning time
  11. ARC, weak references and ownership cycles1code examples1quiz questions5minutes estimated learning time

Practical Swift

5 lessons · 21 min
  1. Throw and handle recoverable errors1code examples1quiz questions4minutes estimated learning time
  2. Read input and work with files1code examples1quiz questions5minutes estimated learning time
  3. Codable and JSON data1code examples1quiz questions4minutes estimated learning time
  4. Swift packages and modules1code examples1quiz questions4minutes estimated learning time
  5. Test behaviour and read diagnostics1code examples1quiz questions4minutes estimated learning time

Concurrency

3 lessons · 14 min
  1. Async and await: suspension is not blocking1code examples1quiz questions4minutes estimated learning time
  2. Structured tasks and cancellation1code examples1quiz questions4minutes estimated learning time
  3. Actors and isolated mutable state1code examples2quiz questions6minutes estimated learning time

Build a Project

1 lessons · 6 min
  1. Build a validated student report1code examples2quiz questions6minutes estimated learning time