So I started using SwiftUI this last week and thought I would write about something I have been able to make over the brief time I have used it for. While SwiftUI makes designing new applications extremely easy; I couldn’t help but notice how much Apple has simplified UI components. Sometimes a bit too much.
So I have been able to make a simple on boarding flow and a log in page. I have not integrated the app with Firebase as yet, but I just wanted to see how to go about creating a flow where when user taps on a button, he / she is taken to the main app (tab bar View).
SwiftUI framework has numerous property wrappers and understanding each one and knowing which to use and when to use should be your main target.
In this article, I will be using @EnvironmentObject. EnvironmentObject is combination of @ObjectBinding (another wrapper) and Singleton. In principle, it should be injected in the initial view of the view hierarchy. Something which is done in SceneDelegate. Once done, this property will be usable throughout any view that your initial view presents or hosts.