Over the lifetime of a view, the init gets called many times as the swiftui framework updates the view based on changes to its data by the parent view.
when this happens do all the properties get reinitialized even the ones that arent marked for change (eg let member1: String = "SomeString"
, which is neither a Binding or a State)
Yes. It is recommended that View.init's are cheap and don't have any side effects.
If it is truly constant you can also use a static let.
4 Likes