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.
Post
Replies
Boosts
Views
Activity
Oh wow. I was going to use a TSI on this but after seeing that simple example I'm thinking otherwise.
@bob_mosh, does your app work fine in the simulator? Mine does. You described almost exactly what I'm hitting.
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.
Same for me with erratic behavior. I upgraded to Big Sur 11.3.1 and didn't see it happen on my iPhone. Thinking it was fixed I made a TestFlight of the app I'm building and the first other iPhone I try it on has the problem. I had to expire the build and am still stuck.
I tried to get a WWDC lab about this issue but the request was rejected.
This problem finally stopped happening for me with the RC of Xcode and iOS 15.
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.
That's my scenario also (sheet).
I have now tested on an iPhone running iOS 16 beta 8 using Xcode 14 beta 6. The problem is still happening.
The app name is populated correctly in the shortcut in the Shortcuts app.
I can use the phrase with the app name when I ask Siri to run the new shortcut.
SiriTipView still shows ${APPLICATIONNAME} in my phrase.
Found an interesting blog post about this.
https://www.donnywals.com/xcode-14-publishing-changes-from-within-view-updates-is-not-allowed-this-will-cause-undefined-behavior/
My app language is set to system language. I switch between that and German.
Mine wasn't rejected and I've made several updates already also.
Thanks for that. Very interesting. I wonder if there's a way then that I could produce an hourly precipitation graph for snow that would have similar values to what the iOS weather app shows.
Happening to me on iPadOS 16.3. Just went and tried on my iPhone running the latest iOS and I get the same problem.