URLNavigator provides an elegant way to navigate through view controllers by URLs. URL patterns can be mapped by using URLNavigator.map(_:_:) function.
URLNavigator can be used for mapping URL patterns with 2 kind of types: URLNavigable and URLOpenHandler. URLNavigable is a type which defines an custom initializer and URLOpenHandler is a closure which can be executed. Both an initializer and a closure receive an URL and placeholder values.
Navigator.map("myapp://user/", UserViewController.self)
Navigator.map("myapp://post/", PostViewController.self)
URLNavigator can be used for mapping URL patterns with 2 kind of types: URLNavigable and URLOpenHandler. URLNavigable is a type which defines an custom initializer and URLOpenHandler is a closure which can be executed. Both an initializer and a closure receive an URL and placeholder values.
Navigator.map("myapp://user/
Navigator.map("myapp://post/
Navigator.map("myapp://alert") { url, values in
print(url.queryParameters["title"])
print(url.queryParameters["message"])
return true
}
GitHub devxoul/URLNavigator
Comments
Post a Comment