Skip to content

Latest commit

 

History

History
6 lines (5 loc) · 820 Bytes

File metadata and controls

6 lines (5 loc) · 820 Bytes

Base code is from Paul Hudson's 100 Days of SwiftUI.

Challenge Day 52

  1. Our address fields are currently considered valid if they contain anything, even if it’s just only whitespace. Improve the validation to make sure a string of pure whitespace is invalid.
  2. If our call to placeOrder() fails – for example if there is no internet connection – show an informative alert for the user. To test this, just disable WiFi on your Mac so the simulator has no connection either.
  3. For a more challenging task, see if you can convert our data model from a class to a struct, then create an ObservableObject class wrapper around it that gets passed around. This will result in your class having one @Published property, which is the data struct inside it, and should make supporting Codable on the struct much easier.