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.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: