button / DeepLinkKit

A splendid route-matching, block-based way to handle your deep links.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use as internal router

alcarvalho opened this issue · comments

I would like to use this library as an internal router, too. Has anyone used for this yet?

In my view, for this use case, it would be nice to have a method in DPLDeepLinkRouter that returns the configured ViewController for a URL. To make it easier customizing transitions or even setting cached values on the target ViewController.

Another thing that may help is to separate the logic for matching and creating the DPLDeepLink. With this I could subclass the DPLDeepLinkRouter to make the above mentioned functionality available much easier.

Any thoughts on this? I could do it and create PR.

@alcarvalho this is a really interesting idea and we've thought about building an app entirely on top of this. @chrismaddern may have already explored this a bit. The matching logic is separate from the router, but the matcher is used internally. Feel free to submit a PR and we'll have a look.

+1 The ancient Three20 library invented this concept, but it'll be nice to see a modern version.

I have an internal implementation that repurpose deep link to support internal url routing.

My few complains is that the current pattern force you to initialise a view controller with incomplete data because deep link instance is not pass down to the method targetViewController, while we rely on configureDeepLink to make sure the view controller is fully initialise. This felt counter intuitive.

Also, we can also pass deep link instance when doing calling presentation as well. This will enable so much flexibility (for example if I need to push more than 1 controller onto the navigation stack)

It actually work out of the box, as long as you hold an instance to the router, you can just call handleURL and it will do the routing for you.

A URL to ViewController would be awesome.

I am not sure what you mean about the problem for initializing the view controller with incomplete data, but if you mean passing data on constructor that's true. But it's also a way to have the view controllers instantiated from the Storyboard and then configure it.

A URL to ViewController would be awesome.

That's actually what I have implemented in #61

Closing in favor of #62