Post

Replies

Boosts

Views

Activity

Comment on SwiftUI's onAppear() and onDisappear() called multiple times and inconsistently on iOS 14.1
State variable does not work. it actually seems to fail a the end. by guarding against boolean state before executing code such as a print statement .onDisappear { if canExecuteOnDisappear { print("CDM onDisappear") canExecuteOnDisappear = false } } The most of the time it works. two times now I observed that the very last time this is called in succession , lets say after 2 times previously, it will print multiple times.
Aug ’23
Comment on ForEach Breaks Data Binding
This was not the solution, my view is already inside of a HStack, what did the solution to me was the ForEach not using a range. I think when you use a range, where its 0..<(some bindingvar).count) the range is not updated on struct, however the other constructor of ForEach that you used.. ForEach([Hashable]), it will update.
Dec ’21