Adding data to Firestore from a SwiftUI App

  Рет қаралды 12,390

Firebase

Firebase

Күн бұрын

Today, we'll be looking at how to create a simple SwiftUI screen for adding a new book to Firestore. Along the way, we will refactor our existing code and introduce a new view model. And since Peter likes to live on the bleeding edge, we will use some features Apple announced at WWDC 2020 just a few days ago.
Chapters:
0:00 Introduction
0:49 A closer look at the screen flow of our application
2:02 Implementing a a view model for our new screen
2:55 Building a new screen for adding new books
3:37 Instantiating the view model
4:01 Why we use @StateObject
7:32 Saving a book to Firestore from our view model
8:28 Navigating to the new screen from our main screen
10:40 Demo time!
11:07 What's wrong with the NumberFormatter?
12:00 Peter discusses the UX (or the lack thereof) of having to hit [enter] to trigger the NumberFormatter
12:31 Implementing a modification tracker using Combine
16:38 Challenge: implement a better modification tracker!
17:42 Wrap-up
Resources:
BookSpine Repository → goo.gle/3iv12R4
Follow Peter’s blog → goo.gle/2Y114cK
Setting up Firebase for iOS → goo.gle/39xIIBZ
Build a todo app w/SwiftUI & Firebase playlist → goo.gle/39UUab3
SwiftUI and Firebase playlist → goo.gle/3f9Uiav
Subscribe to Firebase → goo.gle/Firebase
#FirebaseSemiLive

Пікірлер: 15
@gangalo68
@gangalo68 4 жыл бұрын
The irony when a Google guy has the best Swift tutorials. Thanks Peter.
@nat.serrano
@nat.serrano 2 жыл бұрын
right!? Apple doesn't like this lol
@johngrauel1661
@johngrauel1661 2 жыл бұрын
I'm building my first SwiftUI + Firebase app. I've been stuck for three days. I found this tutorial and was able to understanding and fix my problem in about 10 minutes. Thanks Peter!
@Firebase
@Firebase 2 жыл бұрын
We're delighted to hear that the tutorial helped, John! Be sure to check out the Build a todo app w/SwiftUI & Firebase playlist: goo.gle/39UUab3 😁 👍
@Marvelus2009
@Marvelus2009 3 жыл бұрын
thank you Peter, can you do more tutorials on Firestore + Combine in SwiftUI please.
@nolansingroy3252
@nolansingroy3252 2 жыл бұрын
Im getting error in viewmodel -> Cannot convert value of type 'Book' to expected argument type '[String : Any]' in the addBook function any clues using xcode 13 with swift 5
@UniTechOnline
@UniTechOnline 4 жыл бұрын
Excellent video series thank you. Could you demonstrate how to fetch and display a document that includes an array please? I can’t seem to work it out.
@christianbearden8849
@christianbearden8849 4 жыл бұрын
I forked the repo and sent the request. I am a novice programmer but I am really interested in making clean, easy to maintain, code. I used the Repo-VM-VM-View and added a search bar. Issues: Are the BookCellViewModel and BookListViewModel the best way to approach this? I tried to use this with the search bar to branch out and I am stuck. Side note: Can this series clarify Using Resolver and Disk like the MakeItSo finished repo and add google sign in with the same way of migrating data? thanks again Peter, and I hope I can keep progressing on these tutorials.
@pickemparty
@pickemparty 3 жыл бұрын
Do you have any videos for pagination with SwiftUI!? Nobody seems to be discussing the best practices for it!?
@dongxiang9370
@dongxiang9370 Жыл бұрын
Excellent Tutorial! thanks for efforts. Can we avoid using Combine by building conditions in "save" function, like: if !(book.author == "") && !(book.title == "") && !(book.numberOfPages == 0), which could be much simpler?
@arturofm
@arturofm 3 жыл бұрын
Anyone else getting an error in BookRowView?
@James-pj6cg
@James-pj6cg 2 жыл бұрын
Did the forth video every get posted?
@lpuzer
@lpuzer 3 жыл бұрын
Anyone can give me an idea about how to delete a task on Firestore, using that Peter's project?
@lickmyshoe182
@lickmyshoe182 Жыл бұрын
What do you use instead of .addDocument(from: )?? It’s been deprecated but no idea what to use instead? Please help
Building a to-do list app with SwiftUI and Firebase - Pt 1
53:56
Mapping Firestore documents using Swift Codable
14:28
Firebase
Рет қаралды 21 М.
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 12 МЛН
Doing This Instead Of Studying.. 😳
00:12
Jojo Sim
Рет қаралды 19 МЛН
5 uses for Cloud Functions | Get to know Cloud Firestore #12
19:47
Codelab: Friendly eats in Flutter
46:35
Firebase
Рет қаралды 15 М.
Unit testing security rules with the Firebase Emulator Suite
31:24
Cloud Firestore Data Modeling (Google I/O'19)
40:37
Firebase
Рет қаралды 172 М.
How to Structure Your Data | Get to know Cloud Firestore #5
13:57
What's going on with Windows Laptops?
10:30
Marques Brownlee
Рет қаралды 2,5 МЛН
SwiftUI: Fetching data from Firestore in real-time
13:52
Firebase
Рет қаралды 31 М.
How to Setup Firestore database for your SwiftUI app (2021)
26:32
CodeWithChris
Рет қаралды 25 М.
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 14 МЛН
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 12 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 64 МЛН
Bluetooth connected successfully 💯💯
0:16
Blue ice Comedy
Рет қаралды 1,5 МЛН