Where does the logic go with SwiftUI compared to React?
You can make dependsOnSomeStateVariable
a computed property.
var dependsOnSomeStateVariable: Int { someStateVariable ? 0 : 1}
As far as I know the exact View
lifecycle is not documented (but some of it has been reverse engineered
For observed objects (@ObservedObject
) you can listen for published changes (objectWillChange
, usually in combination with DispatchQueue.main.async
).