Githawk: Evaluate routing libraries and blog posts

Created on 13 Aug 2018  ยท  17Comments  ยท  Source: GitHawkApp/GitHawk

Blog Posts

  • [ ] [A Flexible Routing Approach in an iOS App](https://medium.com/rosberryapps/the-flexible-routing-approach-in-an-ios-app-eb4b05aa7f52)
  • [ ] [URL Routing in iOS apps: Compass Beginner Guide](https://medium.com/flawless-app-stories/url-routing-with-compass-d59c0061e7e2)
  • [ ] [Universal links in iOS](https://medium.com/@abhimuralidharan/universal-links-in-ios-79c4ee038272)
  • [x] [Coordinator essentials pt 1](https://medium.com/blacklane-engineering/coordinators-essential-tutorial-part-i-376c836e9ba7)
  • [x] [Coordinator essentials pt 2](https://medium.com/blacklane-engineering/coordinators-essential-tutorial-part-ii-b5ab3eb4a74)

Criteria

  • Deep Links: Does the lib have external "open url" support?
  • Data Params: Can you provide arbitrary data when navigating?
  • Deep Nav: Does navigation support arbitrary nesting (not just push a single VC)
  • Tab Selection: Does the lib allow selection of UITabBarController?
  • Split VC: Does the lib automatically support UISplitViewController?
  • Custom Transitions: Can you do custom VC transitions?

Legend

  • โœ… Supported
  • โŒ Not supported
  • โš ๏ธ Supported with manual implementation

Libraries

Name | Deep Links | Data Params | Deep Nav | Tab Selection | Split VC | Custom Transitions
---|:-:|:-:|:-:|:-:|:-:|:-:|
Compass |โœ…|โœ…|โŒ|โŒ|โŒ|โš ๏ธ|
URLNavigator |โœ…|โœ…|โŒ|โŒ|โŒ|โš ๏ธ|
DeepLinkKit |โœ…|โœ…|โŒ|โŒ|โŒ|โš ๏ธ|
routable-ios |โœ…|โœ…|โŒ|โŒ|โŒ|โŒ|
Router |โœ…|โœ…|โŒ|โŒ|โŒ|โš ๏ธ|
WAAppRouting |โœ…|โœ…|โŒ|โœ…|โŒ|โš ๏ธ|
HHRouter |โœ…|โœ…|โŒ|โŒ|โŒ|โŒ|
Marshroute |โœ…|โš ๏ธ|โŒ|โŒ|โŒ|โœ…|
swift-deep-linking |โš ๏ธ|โœ…|โŒ|โŒ|โŒ|โœ…|
RxCoordinator |โŒ|โš ๏ธ|โŒ|โŒ|โŒ|โœ…|
route-composer |โŒ|โš ๏ธ|โŒ|โŒ|โŒ|๐Ÿคทโ€โ™€๏ธ|
JLRoutes |โœ…|โœ…|โŒ|โŒ|โŒ|โš ๏ธ|

๐ŸŽฏ project management

Most helpful comment

Do you still want to do more investigating? This is an _awesome_ resource ticket by the way, maybe we should put it in a blog post of some sorts.

All 17 comments

JLRoutes / knil?

Sent with GitHawk

Compass

  • Register strings w/ string params
  • Create Router conforming objects and globally register them
  • Manually push/present from the currentViewController

    • Docs: "The current controller" - how is this determined?

    • Provided as from: param

URLNavigator

  • Params can string, int, float, path
  • Register urls with handlers

    • Handlers return view controllers

    • Can also return "true" and do your own handling

  • Can add a wrap: param to wrap a VC in another VC (e.g. UINavigationController)
  • Set "extra" data in a context object
  • Custom value converters

DeepLinkKit

  • Register handlers for path strings with params

    • Exactly like Compass

  • Blocks or classes as handlers
  • Extremely limited, but maybe a good thing

routable-ios

  • Set a global UINavigationController that you always nav to
  • Register classes to strings

    • Must implement initWithRouterParams: in VC

  • Can have anon blocks execute for routes
  • Options object with modal, presentation style, transition style, and default params

Router

  • Create a navigation enum
  • Handle enum in switch and return VCs
  • Faster compile times??? I don't think this is real

WAAppRouting

  • Register block handlers to strings with params
  • VCs implement reloadFromAppLinkRefresh

    • VCs have a dictionary of stuff, access dictionary in this method

    • Weird that its not just a param

  • Create entities that can have:

    • Source VC type

    • Target VC type

    • "presenting controller" (example has this as a nav)

    • Modal, params

HHRouter

  • Register VC for string path

Marshroute

  • Transition events forwarded to "top view controller"
  • Use different method names to do different transitions (push, present)
  • Supports UIKit custom transitions
  • 3d touch baked in
  • Examples all use VIPER architecture and are extremely confusing

swift-deep-linking

  • Create paths w/ .term(...) enums and params. Strict typing on paths
  • Params can be string, int, bool, double
  • In AppDelegate method, use DeepLinkRecognizer to cast to registered link

    • Then have to do your own switch type fork + custom handling method

There are other deep linking libraries for Swift developers, some of which have much more functionality and flexibility. Based on my experience developing iOS and tvOS apps that need deep linking, this suits my needs. Sometimes less is more.

๐Ÿ˜Š

RxCoordinator

  • "Reactive" navigation ๐Ÿ˜ฌ
  • Create an enum with all paths "for a particular flow"

    • "Flows" are modularized

    • "create a new Route/Coordinator whenever a new navigation controller is needed."

    • Implement "prepareTransition" method and handle

  • Return custom animation objects
  • NOT for app links, purely a "coordinator"
  • Can have custom coordinators too

route-composer

  • Routers, destinations, finders, factories, steps, tasks... so many things!
  • Love the typing, but I just don't get how all of this is supposed to work

JLRoutes

  • Has the most stars so must be the best ๐Ÿ˜œ
  • String paths and params like normal
  • Handler block registration

    • Return YES when its handled

  • Can register anything as JLRRouteHandlerTarget and implement initWithRouteParameters

Do you still want to do more investigating? This is an _awesome_ resource ticket by the way, maybe we should put it in a blog post of some sorts.

Closing since what I built solves the problem. Agree, this could def be a blog post along w/ where we landed!

Just wanted to drop a link here to this related PR, because I was curious how this issue turned out and it took me a while to find the answer.

Thanks @bellebethcooper! Iโ€™ll be updating with more ideas for basic routing in GitHawk soon too ๐Ÿ˜‡

Sent with GitHawk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weyert picture weyert  ยท  3Comments

BasThomas picture BasThomas  ยท  3Comments

rnystrom picture rnystrom  ยท  3Comments

BasThomas picture BasThomas  ยท  3Comments

BasThomas picture BasThomas  ยท  3Comments