Skip to content
Theory · Final project · lesson 5 of 5

What comes next

The expense ledger is done. The program knows its tabs, keeps the receipts, adds up the totals in the same order every time and sets wrong lines aside with a reason. It is small, but almost the whole course works inside it: an enum, a struct, a protocol, an array, a dictionary, a closure and errors.

Big programs are put together the same way: from the same types, functions and collections, only more of them. Let's see what you can do now and where to go next.

What you can do now

During the course you learned to:

  • write and run a program and read the compiler's messages;
  • keep values in constants and variables, calculate, compare, branch your code and repeat it in loops;
  • move code into functions, open optionals safely, and throw and catch errors;
  • work with strings, arrays, dictionaries and sets and pass closures to map, filter and reduce;
  • describe your own types with enums, structs and classes, and shared abilities with protocols and generic code;
  • explain when ARC frees an object, and break a strong reference cycle with weak;
  • wait for long work with async and await without blocking the program, run jobs at the same time with async let, and protect shared data with an actor.

That is enough to read small Swift programs and work through the examples in Apple's documentation. What looks unfamiliar in them will more often be names from libraries than the language itself.

Apps: Xcode and SwiftUI

The course taught the language itself, without screens and buttons, as the very first lesson said. Apps for iPhone, iPad and Mac are written in Xcode. Instead of a single main.swift file, there is a project of many files, and the screens are described with SwiftUI, Apple's library for user interfaces.

In SwiftUI you'll meet familiar things:

  • a screen and each of its parts is a struct that conforms to the View protocol;
  • its computed property body describes what to show on the screen;
  • a button takes a closure: the code that runs when it is tapped;
  • a data model like Expense stays a plain struct, and the screen only shows it.

So the next step toward apps is learning material on SwiftUI: Apple has free step-by-step tutorials. You already know the language; what's left is to learn the library.

Here the ledger picture ends. A real expense-tracking app keeps the receipts between launches and shows them on a screen. That takes no new language constructs but libraries: SwiftUI for the screens and other Apple libraries for storing data.

Swift beyond Apple devices

Swift also runs on Linux and Windows. It is used to write servers, programs that answer requests from websites and apps. There are ready-made libraries for this, and the best known of them is Vapor.

Swift is also used for programs that run in the terminal, like the examples in this course. The model from the final project fits there too: the enum, the struct and the parse function don't depend on where the program runs.

The interview

If you are signed in and have completed every lesson, the "Finish the course" button at the bottom of this lesson opens the course completion page. It has two buttons:

  • "Practice a Swift interview" opens the interview simulator;
  • "Swift roadmap" opens the roadmap with every Swift topic, including those the course didn't touch: SwiftUI, UIKit, networking and data storage.

The simulator also opens from the site menu. The simulator has quizzes with answer options, like the ones in this course, and an interview where you answer in your own words and an AI grades the answer. Its questions cover both the course's topics and what the course didn't touch.

The questions you have already worked through in the lessons are a good warm-up for it:

  • how let differs from var;
  • what an optional is and why ! is dangerous;
  • how a struct differs from a class;
  • how map, filter and reduce differ;
  • what a strong reference cycle is and how to break it with weak;
  • how try? differs from try! and from do/catch.

Try answering each one out loud, as in a real interview: briefly, with a code example.

Key points

  • The course taught the Swift language: values and types, functions, collections, your own types, errors, memory and asynchronous code.
  • Apps for iPhone and Mac are written in Xcode, and their screens are described with SwiftUI: structs that conform to the View protocol.
  • Swift also runs on servers and in programs for Linux and Windows.
  • The next step is the interview simulator: the "Practice a Swift interview" button on the course completion page, or the site menu.