Small lightweight library to provide pure SwiftUI navigation in app
- Add SwiftUI via PackageManager
- Add import to your files
import SwiftUINavigator
- Make your screen Views to implement IItemView protocol
struct SampleView: View, IItemView {
var listener: INavigationContainer?
}
- Call navigation methods of listener to make a magic:
self.listener?.push(view: SecondView())
Profit!
To return to previous screen:
self.listener?.pop()
To return to root:
self.listener?.popToRoot()