This bug is still in the Release Candidate. It means when you have a document based #SwiftUI app, you can't use leading items in the navigation bar. They will just disappear every time the app saves the changes in a document. 😔
mastodon.social/@sandropennisi

Follow

@sandropennisi I also saw @bdewey having issues with DocumentGroup + NavigationStack. iosdev.space/@bdewey/111041862

For what it’s worth, the navigation APIs have been absolutely shocking. Not sure what’s going on over there.

@phill @bdewey oh that’s interesting. Yeah i have tons of weird behavior with navigation too in some of my other apps. Very weird. And document based SwiftUI app was broken from the start. Now in some areas it’s better but broken in new ones. It feels like i have to work around weird issues all the time.

@sandropennisi @bdewey do yourself a favour: stop using these APIs. Seriously.

Write a light wrapper around UINavigationController. It won’t take you long, and I guarantee you’ll have far fewer issues. And if you do, you can actually fix them.

Happy to exchange notes if you’re interested :-)

@phill @sandropennisi @bdewey I've had quite a “war” with SwiftUI's NavStack. I think I have something that is working enough, but I may end up going down this route…

Ie, I've made my own Sidebar via an .overlay{}, & just have the NavStack go into a router.

@phill @bdewey i guess you’re probably right 😅 the thing is, at least in my case, i never have to (or even can) create a navigation thing explicitly. With DocumentGroup it’s just there. So I’m not even sure if i could do it.

@sandropennisi AFAIK DocumentGroup is a wrapper around UIDocument + view management, so I’d say it’s still worth exploring your own. 99.99% of my SwiftUI issues are at the UIKit/AppKit border. Apple’s implementations for whatever reason are just extremely problematic.

@phill i guess you’re right. I’ll probably make an example project to test if i can do it. Thanks again for the input

Sign in to participate in the conversation
The Not So Big Company

The home of The Not So Big Company on Mastodon.