Post

Replies

Boosts

Views

Activity

Comment on SwiftUI View leaks in iOS 17
The problem is not if the @State property does not become nil, it does. The problem is your SomeModalViewModel will never deinitialise. Just add this to SomeModalViewModel and you will see the problem did not disappear. deinit { print("Model Class deinit") }
Nov ’23
Comment on SwiftUI View leaks in iOS 17
Unfortunately, we can't use bindings in this workaround. The plenty of sheets usage looks like this .sheet(item: $object). Hopefully it will be fixed in some iOS/SwiftUI version in some nearest future. Because we have huge memory leaks, awful workarounds to fix them and waste of time. Would be nice if Apple can provide a real workaround which can fully replace native sheet and fullScreenCover by overloading that View methods, but I did not find that yet on the internet(((
Nov ’23