marwaniaaj / FirestoreCodableCoreDataSwiftUI

Firestore and Codable NSManagedObject subclass in SwiftUI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firestore and Codable NSManagedObject subclass in SwiftUI

Sample app to demonstrate how to encode/decode Firestore document data to Core Data NSManagedObject subclass using Codable API, and use @FetchRequest to display data in SwiftUI views.

Project overview

Since Firestore's support for Swift's Codable API, it became easier to map Firestore data to any object that conforms to Codable protocol, but NSManagedObject subclass does not conform to Codable, and we have to do that manually.

Medium Article:

Firestore and Codable Core Data NSManagedObject in SwiftUI

References

Build and Install

Requirements:

  • iOS 16.6+
  • Xcode 15
  • Swift 5.9

About

Firestore and Codable NSManagedObject subclass in SwiftUI


Languages

Language:Swift 100.0%