Hi, I am working on a simple project in swiftUI and have a question which I feel should have an easy answer yet I cannot seem to find one anywhere.
I would like to use a simple button, one that I can configure anywhere, to transition from the current view to another view. Obviously in SwiftUI there are the NavigationView and NavigationLink properties to do this seamlessly but they come with things like navigation titles, back buttons (both of which I’m aware you can hide) and I’m not sure how the data storage for these views works on a device.
I can create this view switching functionality by simply removing the back button and navigation bars and just having one view navigate to the other, then that view has a button that navigates back (but its not really “back” its more foreword to the previous view, if that makes sense), but this seems quite dirty as I’m not sure if there is a bunch of data on the previous views being added up as you click back and fourth.
I’ve done a little of Chris’s stuff with UIKit and I know you can simply make a button function transition to another one of your views, stackoverflow always just tells me stuff about the nav-view and nav-link, but there must be another way. Any help would be greatly appreciated, I’m quite new evidently but SwfitUI is very interesting to me. Thx!
The best would be if I could add a modifier to a button like “.navigationLinkBackButton” to make the functionality of the button the same as the “< Back” link