What's the difference though? You have @State region or @State vm - they are both states of the view. If you (Map) update region, it updates the main view's state. If you (Map) update vm, it has a published property, so it also updates the main view's state. In my simple experiment both of these implementations were causing exactly the same warning. Tested with iOS 16. Which makes sense to me, as both versions are doing the same thing - updating state of the main view.
Post
Replies
Boosts
Views
Activity
I've just stumbled upon the same issue. At first, I had something more complex going on in flatMap and assumed that I created a retain cycle there myself. Then I dumbed down flatMap to just returning Fail, just as in the example above and saw a memory leak. I replaced flatMap with tryMap and the leak was gone. Sadly, for my needs, I do need that flatMap, but I certainly don't understand the reason for that leak...