Post

Replies

Boosts

Views

Activity

Reply to Unable to present. Please file a bug.
Having the same issue with a similar setup others have mentioned. My setup is I use NavigationLink to go to another View. In there I'm using an ObservableObjectPublisher() to indicate changes have happened. Works fine in the simulator and my View gets updated. On my iPhone it kicks me out of the current View the NavigationLink took me to. If I remove the call to the ObservableObjectPublisher() the error isn't displayed but my View isn't updated.
May ’21
Reply to Unable to present. Please file a bug.
I made a super simple test project to try and recreate it. Put it on my phone and it didn't happen. I then recompiled my app and put it on my phone and it didn't happen. The only difference between the last time I tried is that I upgraded Big Sur to 11.3.1. Then uploaded a TestFlight and on that person's iPhone 11 the problem always happens. When I try to update the View it dismisses the current View reached via Navigationlink. I'm seriously confused.
May ’21
Reply to How should I access @AppStorage and @SceneStorage values outside of views?
I just stumbled across this question. I know this is an old thread, but I know the answer for AppStorage. AppStorage is just a more convenient way of writing to UserDefaults. When you're not in a View just use the standard functions for dealing with UserDefaults (UserDefaults.standard.value, UserDefaults.standard.string, etc). I know this works because when I rewrote my app's UI in SwiftUI I had my Views use AppStorage but my underlying, non-view code I left untouched that was using UserDefaults.standard and it continued to work. Just make sure to use the same name in both places.
Dec ’21