Make Me Code Again — Day Three
Happy 🎃 fellas! I don’t celebrate Halloween, we don’t do it at home — cultural bit, but we do give candies when someone knocks our door. And kids are happy this way; however, we are not that rigid, so we let them buy the costume for their school parade.
Today was the day for Handling User Input from Apple Inc tutorial.
What I noticed an interesting Observable Object and how to put the “Toggle Switch” that was a pretty neat bit. The tutorial explained it as follow:
A observable object is a custom object for your data that can be bound to a view from storage in SwiftUI’s environment. SwiftUI watches for any changes to observable objects that could affect a view, and displays the correct version of the view after a change.
It is about an object which will be “observed” by the SwiftUI that got modification and updates. My question is, does it going to maintain the state and stay under observation until the app closes? I will re-read this article to understand a little bit more.
Other than that, I believe this tutorial was easy to follow. I have to re-visit this tutorial to understand a little bit more thoroughly how to bind the “inputs” with an “observable” object and with the data.
See you tomorrow,
Cheers,
Mudassir
Resources:
- Understanding SwiftUI Data Flow — https://medium.com/better-programming/understanding-swiftui-data-flow-79429a49ae35
- Handling User Input — https://developer.apple.com/tutorials/swiftui/handling-user-input