Skip to content

Small lightweight library to provide pure SwiftUI navigation in app

License

Notifications You must be signed in to change notification settings

anioutkazharkova/swiftuinavigator

Repository files navigation

SwiftUI Navigator

GitHub tag (latest SemVer) GitHub last commit License GitHub stars GitHub forks GitHub watchers GitHub followers

Twitter URL

Buy Me A Coffee donate button

Small lightweight library to provide pure SwiftUI navigation in app

How to use:

  1. Add SwiftUI via PackageManager
  2. Add import to your files
import SwiftUINavigator
  1. Make your screen Views to implement IItemView protocol
struct SampleView: View, IItemView {
  var listener: INavigationContainer?
  
 } 
  1. Call navigation methods of listener to make a magic:
 self.listener?.push(view: SecondView())

Profit!

To provide back navigation:

To return to previous screen:

 self.listener?.pop()

To return to root:

self.listener?.popToRoot()