Skip to content

alobanov11/NavigatorSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NavigatorSwift

NavigatorSwift is a lightweight library which allows you not to be crazy with navigation in UIKit, but stay flexible.

How to use

Define an object which conform NavigationProvider protocol or use standart WindowNavigationProvider(). Instantiate Navigator(rootProvider:). If you want to go forward use Presentable protocol, by default UIViewController conform the protocol.

let rootProvider = WindowNavigationRootProvider()
rootProvider.setWindow(window) // async set window

let navigator = Navigator(rootProvider: rootProvider)

navigator.navigate(to: .present(SomeViewController()), animated: true, completion: { print("Done") })
navigator.navigate(to: .present(SomeScreen(id:)))

Also you can make a chain:

navigator.navigate(with: [
	.setRoot(TabsScreen()),
	.setTab(TabsScreen.TabItem.profile.rawValue),
	.push(WalletScreen()),
	.present(Transaction(id:)),
])

navigator.navigate(with: [
	.dismissOnRoot,
	.setTab(0),
	.popToRoot,
])

Requirements

ReactSwift supports iOS 9 and up, and can be compiled with Swift 4.2 and up.

Installation

Swift Package Manager

The ReactSwift package URL is:

`https://github.com/alobanov11/NavigatorSwift`

License

NavigatorSwift is licensed under the Apache-2.0 Open Source license.

You are free to do with it as you please. We do welcome attribution, and would love to hear from you if you are using it in a project!

About

⛵️ Chainable routing for Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages