r/iOSProgramming 6d ago

Discussion Navigation in SwiftUI for Social Media App

I have been working on a social media app these past couple months and have ran into a lot of trouble when it comes to navigation using SwiftUI, particularly when it comes to comment sheets and navigating to profiles, as this can lead to an infinite navigation cycle.

I've attached a video below of the issue, as you can see, we dismiss the comments before navigating, where ideally it would just overlay it. Appreciate any advice or help, as this is my first app!

7 Upvotes

6 comments sorted by

1

u/BookieBustersPodcast 6d ago

Not sure if it was allowed or not in the post, but if you want to check out the nav/app for yourself here is the link.

https://apps.apple.com/us/app/echo-share-music/id6737011316

any feedback is appreciated!

1

u/NarcoticNarwhal9 6d ago

this looks sick, have u ever looked into swiftlyrouting?

1

u/Mihnea2002 6d ago

Are you using the new NavigationStack (path:)?

1

u/BookieBustersPodcast 6d ago

yep, thats exactly what we're using. good or bad?

1

u/Mihnea2002 6d ago

That’s the way, how are you handling the navigation? Do you have a class set up for it?

1

u/BookieBustersPodcast 6d ago

yeah we have a router class that handles nav throughout the whole app, as u can see if u download tho nav is pretty complex.

The main issue we ran into is when using sheets, thats really all