Skip to content

When should I use Handler Block Helper? #103

Open
@ShannonChenCHN

Description

@ShannonChenCHN

Thanks for open sourcing such a great project!

After reading the README documentation, I just couldn't understand the Handler Block Helper part.

The README documentation says:

This is specifically useful for cases in which you want a separate object or class to be the handler for a deeplink route. An example might be a view controller that you want to instantiate and present in response to a deeplink being opened.
...
...

These two mechanisms (weak target and class target) provide a few other ways to organize deep link handlers without writing boilerplate code for each handler or otherwise having to solve that for each app that integrates JLRoutes.

In my opinion, JLRoutes is mainly intended to do 2 things:

  • Routing URLs
  • Decoupling View Controllers

In some cases, using JLRoutes is good for decoupling, but if we use handler block helper classes to define some custom handler classes, we need to import JLRoutes, and implement predefined protocol methods or inherit classes. would this go to the opposite way?

Feel free to point out if I was wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions