Saving Data in iOS

May 31 2022 · Swift 5.5, iOS 15, Xcode 13

Part 2: JSON

16. Codable Hierarchies

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 15. Challenge: Encoding JSON Arrays Next episode: 17. Conclusion

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 16. Codable Hierarchies

This course was originally recorded in April 2020. It has been reviewed and all content and materials updated as of November 2021.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You still need to correctly set up the initial prioritizedTasks array so your app doesn’t crash if you were to run it on a different similator or on a device.

@Published var prioritizedTasks: [PrioritizedTasks] = [
  PrioritizedTasks(priority: .high, tasks: []),
  PrioritizedTasks(priority: .medium, tasks: []),
  PrioritizedTasks(priority: .low, tasks: []),
  PrioritizedTasks(priority: .no, tasks: [])
  ] {
  didSet {
    saveJSONPrioritizedTasks()
  }
}
enum CodingKeys: String, CodingKey {

}
case id = "identifier"
case name
case completed = "isComplete"