Рет қаралды 11,344
In this tutorial, you'll learn how to use the Codable protocol in Swift to fetch data from Firebase Firestore. With Codable, you can easily map your Firestore data to custom model objects, making it easier to work with your data in your iOS application. Follow along as we walk through the steps to set up your Firestore data model and decode your Firestore documents using Codable. By the end of this video, you'll have a solid understanding of how to use Codable to fetch and work with data from Firestore in your Swift application.
🤙 WELCOME BACK 🤙
WEBSITE: www.swiftful-t...
DISCORD: / discord
GITHUB: github.com/Swi...
SAY THANKS: www.buymeacoff...
00:00 Firestore Codable
01:57 Intro
03:40 Managing database references
05:56 Codable
10:52 Encoder for snake_case
12:40 Decoder for snake_case
15:56 Customizing DBUser init
17:40 Adding isPremium
20:06 Updating a struct
27:18 Mutating a struct
30:20 setData vs updateData
34:41 Custom coding strategies
38:45 Custom Coding Keys
42:03 Conclusion