Worked for me on Xcode 15 for iPhone SE 1st gen iOS 15 simulator.
Post
Replies
Boosts
Views
Activity
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") }
Not sure what do you mean by a better solution. Your code is not a solution, the object is not being deallocated when using it.
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(((
Can you please attach the link to release notes, where it's possible to read about this fix?
I can't find any mention about this problem in the 17.2 beta 3 release notes.
Hi @eskimo @defagos , can you please point me to the release notes section where I can read about this issue fix?