EduFlow
Swift Essentials for iOS

Final assessment

Twelve questions across the whole course. Score 70% or more to pass and unlock your certificate. You can retake it as often as you like.

Finish every lesson to earn the certificate — you can take the assessment any time.

Question 1 of 12

expenses is an empty array. What is label?

Swift
let label = expenses.first?.title.uppercased() ?? "NONE"
Question 2 of 12

Pocket Budget needs a sort-order setting with exactly three choices (newest, oldest, largest) shown in a picker and saved to disk. Which type fits best?

Question 3 of 12

Why does the add-expense form keep title, amount and category in its own @State properties instead of writing to the store on every keystroke?

Question 4 of 12

You add case gifts to Category. The project has three switch statements over Category, yet the build passes with no errors. What’s the most likely explanation?

Question 5 of 12

Several tasks fetch rates in parallel and must all update one shared cache. Which declaration keeps the cache free of data races?

Question 6 of 12

The JSON contains "total_spent": 12.5 and your struct has let totalSpent: Decimal. Decoding throws keyNotFound. What’s the cleanest fix?

Question 7 of 12

Users want to pull down on the rates list to refresh it. Which modifier adds that?

Question 8 of 12

In which situation is try? a good choice?

Question 9 of 12

Which declaration shows saved expenses newest first and updates on its own when another screen inserts one?

Question 10 of 12

What does some View in var body: some View promise?

Question 11 of 12

Uploading a new build to App Store Connect fails because that build number was already used for this version. What do you do?

Question 12 of 12

Does this compile?

Swift
@Observable
final class Settings {
    var limit: Decimal = 100
}
let settings = Settings()
settings.limit = 200

12 questions unanswered