Taking the Veteran Approach to the Next Generation
SwiftUI 2.0 brought us a lot of new features. My favorite is the new application lifecycle because it is simpler than the old one, but configuring it with Firebase can be tricky.
This week we will talk about another new API that Apple released this year during WWDC 20. Replacing AppDelegate with the new SwiftUI App Lifecycle brings us tons of new APIs that we can use to replace old functionality with a brand new declarative API. One of those APIs is commands, which we will cover today.
This week we will continue the series of posts about the app and scene lifecycle in SwiftUI. Today we will concentrate on scene management and the features that the new Scene protocol provides us to replace the old SceneDelegate.
SwiftUI gives us equivalents to UIKit’s viewDidAppear() and viewDidDisappear() in the form of onAppear() and onDisappear(). You can attach any code to these two events that you want, and SwiftUI will execute them when they occur.
...This article will dive into the basics of maintaining state throughout the “real world” app lifecycle.