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

Detect tap on hashtag and mention #175

Open
SreelekhN opened this issue May 27, 2024 · 4 comments
Open

Detect tap on hashtag and mention #175

SreelekhN opened this issue May 27, 2024 · 4 comments

Comments

@SreelekhN
Copy link

let hashtag = DetectionTuner {
Attrs(self.hashMentionAttr).akaLink($0.text)
}

How can i detect the tap action on hashtag or mention, with the respective tapped value.
It was there in this library before as a closure, now i am not able to get it after the update.

Any help ?

@SreelekhN
Copy link
Author

@psharanda any help ?
Kinda urgent to know

@psharanda
Copy link
Owner

You may want to use AttributedLabel view, which is a part of AtributikaViews lib

@SreelekhN
Copy link
Author

@psharanda iam using AttributedLabel, here it have this DetectionTuner property.
Which can only help in opening to some specific link.
I want to detect user tap action in mention and hashtag, to open/ redirect within the app.
Whichs not possible with

let hashtag = DetectionTuner {
Attrs(self.hashMentionAttr).akaLink($0.text)
}

this library previously had this, which seems to be missing now or iam i missing it ?

@psharanda
Copy link
Owner

Ok, I see now. AttributedLabel is now working only with untyped string urls and not aware about Atributika lib at all and can be used without it. Check AttributedLabelDemoViewController.swift for the example. Using DetectionTuner tuner you can transform a mention or hashtag into any url format you want e.g. "hashtag://my_hashtag" and then in tap handler you can check the url schema and do the stuff you wanted to do for hashtags.

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