Catalog a ceramic bowl
Before you start this intermediate track
Functions and collections. Work with structs, mutable bindings, and optionals.
Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.
Predict the result.
What catalog entry is printed?
struct Bowl { var glaze: String var fired: Bool}var piece = Bowl(glaze: "blue", fired: false)piece.fired = trueprint("\(piece.glaze): \(piece.fired)")Run each mission independently as a Swift 5.9 or later script or playground. Top-level statements execute directly; these examples need only the Swift standard library and no Apple UI frameworks.
Review the lesson
A pottery catalog keeps related details in a struct. Its stored properties describe one bowl. Swift structs are value types: a constant instance cannot have its properties changed, even if the properties use var. Declaring both the instance and its fired property with var allows the catalog to record the kiln result.