Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use as internal router #60

Closed
alcarvalho opened this issue Jul 1, 2015 · 7 comments
Closed

Use as internal router #60

alcarvalho opened this issue Jul 1, 2015 · 7 comments

Comments

@alcarvalho
Copy link

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.

@wessmith
Copy link
Member

wessmith commented Jul 1, 2015

@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.

@hiroshihorie
Copy link

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

@lxcid
Copy link
Contributor

lxcid commented Jul 10, 2015

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)

@lxcid
Copy link
Contributor

lxcid commented Jul 10, 2015

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.

@lxcid
Copy link
Contributor

lxcid commented Jul 10, 2015

A URL to ViewController would be awesome.

@alcarvalho
Copy link
Author

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

@wessmith
Copy link
Member

Closing in favor of #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants