Appendix A — Glossary
Each entry gives the meaning the course uses and the chapter that teaches the term first or in most depth. Terms in other entries are written in plain text; look them up by name.
A
Access control — Keywords that decide which code can see a declaration. private limits it to the enclosing type; the default, internal, makes it visible anywhere in the same app target. Chapter 4 introduces private; Chapter 10 covers the rest.
Accessibility element — One item that VoiceOver can move to and speak, described by a label, a value, traits and an optional hint. Chapter 11.
Adaptive color — A color that changes automatically with the device's appearance, defined in a color set with an Any Appearance value and a Dark value. Chapter 11.
Argument label — The name written before a value when you call a function, such as sides: in rollDie(sides: 6). Chapter 4.
Array — An ordered collection of values of the same type, written [Int]. Values are read by index, starting at 0. Chapter 6.
Asset catalog — A specially structured folder, Assets.xcassets, that Xcode shows as a visual editor and compiles into the app. It holds color sets and the app icon. Chapter 11.
B
Binding — A two-way connection to a value stored somewhere else. Reading through it gets the owner's current value; writing through it changes the owner's value. Declared in a child view with @Binding; created from @State with $. Chapters 6 (preview) and 10.
Body (body) — The computed property of a view that returns a description of its contents. SwiftUI reads it whenever it needs to know what the view looks like. Chapter 3.
Boolean expression — Any expression whose value is true or false: a comparison, a Bool property, a function that returns Bool, or a combination using &&, || and !. Chapter 7.
Boundary test — A test of the values at the edges of an allowed range, such as the smallest and largest quantity, because most real bugs live at the edges. Chapter 12.
Breakpoint — A marker on a line of code. When the running app reaches the line, it pauses before running it, so you can inspect the program's state. Chapter 12.
Build — Translating your Swift code into an app that can run (⌘B). Running (⌘R) builds and then starts the app. Chapter 1.
Bundle identifier — A unique ID for the app, formed from your organization identifier and the product name, for example com.blackwellfoundry.DiceFoundry. Chapter 1.
C
Canvas — The panel to the right of the editor that shows a live preview of a view, driven by the #Preview block. Show or hide it with ⌥⌘↩. Chapters 1 and 3.
Case (enum) — One of the fixed values an enumeration can have, such as .d6. Chapter 5.
Class — A reference type: when you assign or pass an instance, the copies share a single object, so a change through one is visible through all. RollViewModel is a class. Contrast with structure. Chapter 13.
Closure — A block of code that can be stored and run later. A button's action is a closure. A closure can also capture and change variables from the code around it. Chapters 3, 4 and 12.
Code smell — Repeated or awkward code that is not necessarily a bug but suggests one is likely later. Chapter 10.
Codable — A combination of Encodable and Decodable: a type that can be converted to and from a stored format such as JSON. If all of a struct's stored properties are Codable, the compiler generates the code. Chapter 9.
Compile-time error — An error found when Xcode translates your code into an app. The build fails and nothing runs. Chapter 12.
Computed property — A property that calculates its value each time it is read, from other properties, instead of storing it. body is one. Chapters 3, 5 and 8.
Condition — An expression whose value is true or false, used to choose what code runs. Chapter 7.
Conformance (protocol conformance) — A type promising to meet a protocol's requirements, written after the type's name, as in struct ContentView: View. Chapter 3.
D
Data container — The private set of folders an app is given inside its sandbox, including Documents and Library. Chapter 9.
Data model — A type that represents the information your app works with, independent of how it is displayed. DieType and RollResult are models. Chapter 8.
Declarative — Describing what the screen should look like for the current data, and letting the framework make the screen match, instead of giving step-by-step instructions to change it. SwiftUI is declarative. Chapter 3.
Default parameter value — A value a parameter takes if the caller leaves it out. RollResult's initializer uses defaults for id and date. Chapter 8.
Dependency injection — Handing a dependency, such as a source of randomness or a file location, into a type from outside instead of creating it inside. The course injects the random function in Chapter 12 and the roller and store in Chapter 13. Chapters 12 and 13.
Deployment target — The oldest iOS version the app will run on, set under Minimum Deployments. The course uses iOS 17.0. Chapter 1.
Developer Mode — A setting on an iPhone that Xcode needs before it can install and run your own apps on the phone. You turn it on in Settings → Privacy & Security. Device Lesson D1.
Display name — The name shown under the app icon on the Home Screen. Dice Foundry's is Dice Foundry; the product name is DiceFoundry. Chapter 1.
Dynamic Type — The setting that lets users choose a larger or smaller text size. Text that uses text styles scales automatically; fixed-size elements need @ScaledMetric. Chapter 11.
E
Enumeration (enum) — A type with a fixed list of possible values, called cases. DieType is an enum. Chapter 5.
Expression — Code that produces a value, such as 2 + 3. Chapter 2.
Extension — A way to add methods to an existing type. The course extends View to add cardStyle(). Chapter 11.
F
File inspector — The inspector panel for the selected file, where you check Target Membership. Chapters 1, 5 and 10.
Function — A named block of code that performs one task. You declare it once and call it by name. A function inside a type is a method. Chapter 4.
G
Git — The version control system the course uses to save snapshots of your project (commits) and mark them (tags). Chapter 1.
H
Haptics — The small, precise vibrations produced by the iPhone's Taptic Engine. SwiftUI's .sensoryFeedback(_:trigger:) plays them when a trigger value changes. Chapter 11.
I
Identifiable — A protocol promising that every value has a stable, unique identity in a property named id. SwiftUI uses identity to track which on-screen view belongs to which piece of data. Chapters 5 and 8.
Immutable — Unable to change after creation. A struct whose properties are all let is immutable. RollResult is. Chapter 8.
Initializer (init) — Code that gives every stored property a value when you create an instance. Swift generates a memberwise initializer unless you write your own. Chapter 8.
Instance — One value created from a type. Each RollResult is an instance. Properties that belong to an instance differ from static properties that belong to the type. Chapter 9.
J
JSON — JavaScript Object Notation, a text format almost every language and tool can read. Dice Foundry saves its history as JSON in roll-history.json. Chapter 9.
K
Key path — A way of naming a property without reading it. \.self means "the whole value", and \.accessibilityReduceMotion names an environment value. Chapters 6 and 11.
L
LLDB — The debugger console in Xcode's debug area, which accepts commands such as po and p. Chapter 12.
Logic error — The project builds and runs without crashing, but the answer is wrong. Only a check against an expected result catches it. Chapter 12.
Loop — Code that runs the same block several times. for … in runs its body once for each value in a sequence. Chapter 6.
M
Macro — An instruction to the compiler to generate extra code for a declaration. @Observable is a macro. Chapter 13.
Method — A function declared inside a type. Chapter 4.
Model — See data model. In MVVM, the data types and the rules about them. Chapters 8 and 13.
Modifier (SwiftUI) — A method you call on a view that produces a new, adjusted view, such as .padding(). The order of modifiers matters. Chapter 3.
MVVM — Model, View and View Model: an arrangement where a view model holds the screen's state and logic, views draw it, and models describe the data. Chapter 13.
N
Namespace — A named container for related constants. The course uses a caseless enum named Theme for this. Chapter 11.
Navigator — The panel on the left of the Xcode window that lists the project's files and other views. Chapter 1.
O
@Observable — A macro, available from iOS 17, that makes a class report every change to its stored properties so that SwiftUI updates the views that read them. It works only on classes. Chapter 13.
Optional — A type that is either a value or nil, written String?. Unwrap it with if let or give it a fallback with ??. Chapter 2.
P
Parameter — A named input to a function, declared with a name and a type. Chapter 4.
Persistent — Stored so that it survives the app quitting, unlike volatile data in memory. Chapter 9.
Property wrapper — An annotation that wraps a property with extra behavior. @State is one. Chapter 4.
Protocol — A named list of requirements, such as properties and methods, that a type must provide. Chapter 3.
R
Reduce Motion — A setting for people who are uncomfortable with motion. Apps should replace large movement with no animation or a gentle fade. SwiftUI exposes it as accessibilityReduceMotion. Chapter 11.
Reference type — A type whose copies share one underlying instance. A class is a reference type. Chapters 8 and 13.
Refactoring — Changing the structure of code without changing its behavior. Chapter 10.
Runtime error — An error that happens after the app builds and starts, such as an array index out of range. Chapter 12.
S
Sandbox — The private set of directories iOS gives each app. Only that app can read and write them. Chapter 9.
Scope — The region of code, set by braces, where a name exists. Chapter 2.
SF Symbols — Apple's library of icons that match the system font, scale with text and take on colors, used with Image(systemName:). Chapter 3.
Signing — Xcode's process for proving to iOS who built an app. A target signs with a Team. Chapter 1 sets Team to None for the Simulator; Device Lesson D1 covers the phone.
Simulator — The program that runs iOS on your Mac, so you can install and tap your app without a phone. Chapter 1.
Single source of truth — The rule that each piece of data has exactly one owner, and everyone else reads it or is given a way to change it. Chapters 8 and 10.
Snapshot — A copy of a value taken at one moment. Dice Foundry copies the modifier and notation when it rolls, so the result describes the last roll and not the current controls. Chapter 7.
State (@State) — A property wrapper that tells SwiftUI to own the storage for a value and read the view's body again when it changes. Chapter 4.
Stored property — A property that holds data. Chapter 8.
Structure (struct) — A value type that groups related properties and behavior. SwiftUI views and RollResult are structs. Chapters 3 and 8.
Swift Testing — Apple's testing framework used in Chapters 12 and 13, with @Test, #expect and #expect(throws:). Chapter 12.
T
Target — One product the project builds. Dice Foundry has an app target, and from Chapter 12 a test target. Chapter 1.
Target membership — The setting that decides which target compiles a file. Chapters 5, 10 and 12.
Team — The Apple account Xcode uses to sign a target. None works for the Simulator. Device Lesson D1 explains choosing your own team for an iPhone.
Ternary conditional operator — condition ? a : b: an expression that yields a if the condition is true and b otherwise. Chapter 5.
Trailing closure syntax — Writing the last closure argument of a call after the closing parenthesis, without its label. Chapter 3.
Trust (developer) — The iPhone setting, under Settings → General → VPN & Device Management, that lets apps from a developer run on the phone. Device Lesson D1.
Type annotation — Writing the type after a colon, as in let sides: Int = 6. Chapter 2.
Type inference — Swift working out a value's type from its initial value. Chapter 2.
U
UserDefaults — A small key-value store for preferences. Dice Foundry's haptics setting uses it through @AppStorage. Chapters 9 and 11.
V
Value type — A type whose copies are independent. Structs, Int, String, Array and Date are value types. Chapter 8.
Variables view — The part of Xcode's debug area that lists local values and the properties of self at a paused breakpoint. Chapter 12.
View — A small Swift value that describes a piece of interface. A SwiftUI view is a struct. Chapter 3.
View model — The object that holds a screen's state and logic. RollViewModel is the course's view model. Chapter 13.
VoiceOver — The built-in screen reader. It speaks each accessibility element's label, value, traits and hint. Chapter 11.
Volatile — Held in memory only. Volatile data disappears when the process ends. Chapter 9.
Symbols
$ (dollar prefix) — Written before a @State property, as in $quantity, it gives a binding: a two-way connection to that state. Chapters 6 and 10.
@AppStorage — A property wrapper bound to one UserDefaults key. Chapter 11.
@Binding — Declares in a child view a binding to a value the parent owns. Chapter 10.
@Environment — Reads a value SwiftUI provides to every view, such as the Reduce Motion setting. Chapter 11.
@main — Marks where the app's execution begins. In Dice Foundry it is the DiceFoundryApp struct. Chapter 1.
@ScaledMetric — Makes a number, such as a size, grow with the user's Dynamic Type setting. Chapter 11.
@testable — An attribute on an import that lets a test target see internal code in the app. Chapter 12.