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

POP Implementation #2

Closed
IanKeen opened this issue May 13, 2017 · 1 comment
Closed

POP Implementation #2

IanKeen opened this issue May 13, 2017 · 1 comment

Comments

@IanKeen
Copy link
Contributor

IanKeen commented May 13, 2017

Hey, Interesting lib

I had a quick play at a protocol oriented version if you are interested

https://gist.github.com/IanKeen/537d70bf02fad763c096e6fbb5c1dc69

The biggest pro to this approach is you are able to break out the highlightable elements and use protocol extensions to provide a default highlighting implementation.

The boilerplate for the elements that conform to Highlightable would have been reduced greatly if UITextView didn't use IUOs for its text/attributedText properties :(

The only API change this introduces is the removal of the HighlighterType enum. Instead you just pass in the type of the item you are targeting i.e. UIButton.self for buttons or nil for everything.

Let me know if you'd be interested in a PR

@younatics
Copy link
Owner

Hello @IanKeen
I love it! Could you make pull request for me?
Thanks!

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

No branches or pull requests

2 participants