Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Make extractURL public #52

Closed
marchy opened this issue Jun 8, 2017 · 2 comments
Closed

Make extractURL public #52

marchy opened this issue Jun 8, 2017 · 2 comments

Comments

@marchy
Copy link

marchy commented Jun 8, 2017

Hi there could you please make the extractURL(...) method public?

This is really useful UX-wise to determine whether a URL WOULD be detected and do some logic against the previously-detected one and thus ONLY invoke a new preview(..) if the URL is different.

This happens when the user types in a text-field and you don't want to fire a new request upon every keystroke. Instead only want to do so when the detected URL has actually changed from the previous one. For example if they type a link in a comment text box and continue to type their message afterwards, the rest of the keystrokes will resolve to the same URL and thus you can skip the URL fetching.

NOTE: The only change required for this is to change the 'internal' keyword to 'public' in the SwiftLinkPreview extension's extractURL(text:) method.

Thx!

@LeonardoCardoso
Copy link
Owner

Fair enough. This is a good point. I've add it on version 2.0.5.

@marchy
Copy link
Author

marchy commented Jun 8, 2017

Awesome, thanks Leonardo!
Now THAT'S turnaround =)

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

No branches or pull requests

2 participants