ios_catalogue1-6 Exercise 1: Build and Use the Form ==================================================== Labels expected for the creator field: Book -> "Author" CD -> "Artist" DVD -> "Director" Blu-ray -> "Director" (The format field's placeholder also changes: "Format (hardcover, paperback...)", "Format (album, single...)", "Edition or region code".) Tapping a different segment relabels the fields at once and keeps the typed text. Creation date check: on the detail screen "Added" shows the same date before and after an edit, because an edit changes the existing Item's fields and never touches createdAt. (Both dates are usually the same day while testing; to see it clearly, temporarily show createdAt with time: .shortened in DetailView.) The wiring, in short: 1. ListView: showAdd state, "+" sets it, .sheet { ItemFormView(item: nil) }; delete addSampleItem and the unused modelContext. 2. DetailView: showEdit state, pencil sets it, .sheet { ItemFormView(item: item) }. Common problems: - The picker shows nothing selected: the row tags are not Optional(type.name), so they do not match the String? selection. Or the types have not loaded yet (the .task(id:) sets the default when they arrive). - "Type 'ItemDraft' has no member 'init(item:)'": the second init is missing or the file is not in the target. - The sheet has no Cancel/Save buttons: ItemFormView's own NavigationStack is missing (a sheet needs one). - Saving does nothing and the console shows an error: read it. If it concerns the relationship or the type, see the note in Not Yet Verified about assigning the type before insertion. - Year field accepts letters: the onChange filter is missing; .numberPad alone does not stop pasted text.