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
#firebase #swift #developer #firestore