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

Add mention and hashtag filtering #61

Merged
merged 3 commits into from
Apr 5, 2016
Merged

Conversation

krjackso
Copy link
Contributor

@krjackso krjackso commented Apr 2, 2016

I needed this feature so that hashtags and mentions that were not actionable/valid in my app would not appear that way to my users (e.g. only @mentions for other valid users should appear to be tappable). I did not add url filtering because I could not think of a valid use for that. With the addition of the customize block a change like this should have little impact for those not using it.

@@ -156,6 +166,9 @@ public protocol ActiveLabelDelegate: class {
private var mentionTapHandler: ((String) -> ())?
private var hashtagTapHandler: ((String) -> ())?
private var urlTapHandler: ((NSURL) -> ())?

private var mentionFilterPredicate: ((String) -> Bool) = { _ in return false }
private var hashtagFilterPredicate: ((String) -> Bool) = { _ in return false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of them should be optional

@polqf
Copy link
Contributor

polqf commented Apr 4, 2016

Thanks for this PR @krjackso , that could be really useful.

Could you please take a look at the tests? Travis is failing

@krjackso
Copy link
Contributor Author

krjackso commented Apr 5, 2016

Okay I made the fixes, which also fixed the build. I also added a test for this functionality

@polqf
Copy link
Contributor

polqf commented Apr 5, 2016

Thanks @krjackso , merging!

@polqf polqf merged commit 5200fde into optonaut:master Apr 5, 2016
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

Successfully merging this pull request may close these issues.

None yet

2 participants