EduFlow
Swift Essentials for iOS

Checkpoint: Building Screens with SwiftUI

Five questions on this section. Answer all of them, then see your score and why each answer is right or wrong.

Question 1 of 5

A child view AmountField declares @State var amount: Decimal, and its parent creates it with AmountField(amount: budget.limit). Typing in the field never changes the parent’s limit. Why?

Question 2 of 5

Which code shows a spending total the way users in different countries expect to read money?

Question 3 of 5

The list uses NavigationLink(value: expense) and .navigationDestination(for: Expense.self). After saving a new expense, you want to open its detail screen from code. What do you add?

Question 4 of 5

A BudgetStore marked @Observable is put into the environment at the app level. A deeply nested LimitSettings view needs a TextField bound to store.monthlyLimit. What does that view write?

Question 5 of 5

AddExpenseView is presented as a sheet and must close itself when the user taps Save. What’s the standard way?

5 questions unanswered