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

Updated URL parser to use NSDataDetector #142

Closed
wants to merge 3 commits into from

Conversation

taylanpince
Copy link

We needed to support user-entered links such as google.com, but the current RegEx based approach was too complicated to support this. We switched to using an NSDataDetector instead, which supports a myriad of link types, auto-parses and converts them to a proper URL object. Updated approach falls back to the RegEx pattern if the data detector cannot be instantiated for any reason.

@polqf
Copy link
Contributor

polqf commented Dec 20, 2016

Hi @taylanpince , the reason why we are not using NSDataDetector is because it is 2x slower than Regex (#40 (comment)). And since this component is heavily used in tables, the performance was heavily affected.

I would rather prefer to polish the current Regex TBH

@taylanpince
Copy link
Author

Fair enough. Our use case is different and getting all kinds of links working is more important so we'Il keep working from our fork. Thanks!

@polqf
Copy link
Contributor

polqf commented Dec 21, 2016

Thanks for your understanding @taylanpince !

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.

2 participants