URLNavigator

⛵️ Elegant URL Routing for Swift

MIT License

Stars
3.2K
Committers
15

Bot releases are hidden (Show)

URLNavigator - v2.5.1 Latest Release

Published by OhKanghoon over 1 year ago

Full Changelog: https://github.com/devxoul/URLNavigator/compare/2.5.0...2.5.1

  • Update deployment target 9.0 to 11.0 by @OhKanghoon
URLNavigator - v2.5.0

Published by OhKanghoon over 1 year ago

What's Changed

Full Changelog: https://github.com/devxoul/URLNavigator/compare/2.4.1...2.5.0

URLNavigator - v2.4.1

Published by OhKanghoon over 2 years ago

What's Changed

Full Changelog: https://github.com/devxoul/URLNavigator/compare/2.4.0...2.4.1

URLNavigator - v2.4.0

Published by OhKanghoon over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/devxoul/URLNavigator/compare/2.3.0...2.4.0

URLNavigator -

Published by devxoul almost 5 years ago

  • Make /foo/bar have higher priority than /foo/<id> (#120, @Paldom)
  • Fix a bug that pattern matches when the url contains another url (#126, @devxoul)
URLNavigator - 2.2.0

Published by devxoul over 5 years ago

  • Add Swift 5 support 🚀 (#118, @alihen)
  • Use key window when pushing or presenting a view controller (#110, @aemoe)
  • Fix a bug that URLMatcher.match() incorrectly matches <path:_> (#117, @RolandasRazma)
URLNavigator -

Published by devxoul about 6 years ago

  • Add Swift 4.2 support 🎉 (#108)
URLNavigator -

Published by devxoul over 6 years ago

  • Support Xcode 9.4 and Swift 4.1.2
  • Removes weak keyword from the property definition in the protocol to remove compiler warning (6e7cfced6027c1d9b73a0a99eedcc90baf442633)
URLNavigator -

Published by devxoul over 6 years ago

  • Fix a bug that queryParameters cannot parse a query parameter that contains an url (#99)
URLNavigator -

Published by devxoul almost 7 years ago

  • Separate missing protocol requirement methods (3f6f735e8280504686d5c1729033b6d8fe573127)
URLNavigator -

Published by devxoul almost 7 years ago

  • Separate protocol requirement methods (#87)
URLNavigator -

Published by devxoul almost 7 years ago

  • Fix a crash from an UIApplication (6dad23eb199cfa2285e9812beeeb3361405ca32e)
  • Use count on a String directly (6a148b7a349b6c5775a2c6ec8ef8629b0c8a0a14)
URLNavigator -

Published by devxoul almost 7 years ago

  • Consider an app extension environment (#82)
  • Supports Xcode 9.1 (Carthage)
URLNavigator -

Published by devxoul almost 7 years ago

Improvements

  • Add NavigatorType protocol. Use this protocol to inject a dependency of Navigator.
  • Add NavigatorDelegate protocol. Use this protocol to decide whether to push or present or not.

Migration Guide

  • Accessing an instance: A singleton instance named Navigator is removed and URLNavigator is renamed to Navigator. You have to create your own instance.

    - Navigator.foo()
    + let navigator = Navigator()
    + navigator.foo()
    
  • Mapping view controllers: Use register() to map view controllers. It takes a view controller factory instead of URLNavigable so that you can inject dependency to the view controller or create a view controller from Storyboard. Also, URLNavigable is removed.

    - Navigator.map("myapp://user/<id>", UserViewController.self)
    + navigator.register("myapp://user/<id>") { (url: URLConvertible, values: [String: Any], context: Any?) -> UIViewController? in
    +   let viewController = storyboard.instantiateViewController(withIdentifier: "foo")
    +   viewController.dependency = injectDependencyHere
    + }
    
  • Mapping url handlers: Use handler() to map url open handlers. URL open handlers now can take context as a third parameter.

    - Navigator.map("myapp://alert") { (url: URLConvertible, values: [String: Any]) -> Bool in
    -   return false
    - }
    + navigator.handle("myapp://alert") { (url: URLConvertible, values: [String: Any], context: Any?) -> Bool in
    +   return false
    + }
    
  • Presenting with a navigation controller: A type of the parameter wrap from present() is changed from Bool to UINavigationController.Type?. Pass nil if you don't want to wrap a view controller with a navigation controller and pass a class reference of UINavigationController or its subclass if you would like to wrap with a navigation controller.

    - Navigator.present("myapp://user/123", wrap: true)
    + navigator.present("myapp://user/123", wrap: MyNavigationController.self)
    
  • Custom URL value converters: URL value converters are now managed with a dictionary. Just set a value with custom value converter. Note that the handler parameters are changed from the single value to the entire path components and an index.

    - URLMatcher.default.addURLValueMatcherHandler(for: "foo") { (value: String) -> Any? in
    -   return value
    - }
    + navigator.matcher.valueConverters["foo"] = { (pathComponents: [String], index: Int) -> Any?
    +   return pathComponents[index]
    + }
    
URLNavigator -

Published by devxoul about 7 years ago

  • Add Swift 4 support ✨
URLNavigator -

Published by devxoul about 7 years ago

  • Add tvOS support (#69)
URLNavigator -

Published by devxoul about 7 years ago

  • Check presented view controller first when finding a top most view controller (5dedbade8c41f6514bb0fc407073db242859684b)
URLNavigator -

Published by devxoul about 7 years ago

  • Fix a bug that topMost returns wrong view controller on UIPageViewController (#63)
URLNavigator -

Published by devxoul over 7 years ago

  • Add an exception handling for pushing/presenting an UINavigationController (#59)
URLNavigator -

Published by devxoul over 7 years ago

  • Make UIViewController.topMost(of:) open (c86b5d8bb70bc9f51cd92a7b7226198bc783177d)
Package Rankings
Top 7.54% on Swiftpackageindex.com
Top 16.29% on Carthage
Top 0.83% on Cocoapods.org
Badges
Extracted from project README
CocoaPods Build Status CodeCov