Swiftpack.co - alobanov11/NavigatorSwift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by alobanov11.
alobanov11/NavigatorSwift 1.0
⛵️ Chainable routing for Swift
⭐️ 0
🕓 32 weeks ago
.package(url: "https://github.com/alobanov11/NavigatorSwift.git", from: "1.0")

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!

GitHub

link
Stars: 0
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics