Module 11 of 12

Persistence & Device Features

Lessons

About This Module

An app that forgets everything when you close it isn't much use. This module covers how to save data on the device so it's still there next time, and how to start working with what the device itself can do.

You'll start with the simplest option, saving small values like settings with UserDefaults and @AppStorage. Then you'll move up to SwiftData, Apple's framework for storing structured data such as lists of items. Finally, you'll get a first look at device features by working with location and maps using Core Location and MapKit.

The maps video is older and uses UIKit, but it shows how location permission and updates work. When you're ready, continue on to Testing, Debugging & App Store.

Lessons

4 videos
01

AppStorage in SwiftUI & UserDefaults in Swift

Save small pieces of data like settings and preferences so they persist between launches.

02

Saving User Data with @AppStorage

See @AppStorage used in a real app to store account details on the device.

03

SwiftData Todo List App

A playlist that builds a to-do list app with SwiftData, covering models, saving, and loading data.

04

MapKit & Core Location

Work with maps, request location permission, and show the user's location.