How to make clickable expression on iOS?

I am writing a client like Twitter. I need things like @ and # clickable. When I click on it, I want it to do something like IBAction. I found this for OSX:

http://flyosity.com/mac-os-x/clickable-tweet-links-hashtags-usernames-in-a-custom-nstextview.php

This is consistent with what I want to accomplish. Anything for iOS of this caliber?

+3
source share
4 answers
0
source

The best solution I've found is: https://github.com/SebastienThiebaud/STTweetLabel Clean and simple.

+4
source

You can make everything correctly formatted URLs as blue underlined active links in a UITextView with the following code (e.g. viewDidLoad )

 self.myTextView.editable = NO; self.myTextView.dataDetectorTypes = UIDataDetectorTypeLink; 

Find "Technical Q & A QA1495" in the Xcode documentation and API Reference.

+3
source

On top of my head, I think you could achieve this by using a UIWebView to display content (which you linked as part of the โ€œ2: Finding interesting partsโ€ blog).

If you then prefix the hashtag link with a custom URL scheme, for example myappopenshashtags:// , and register this URL scheme for your application, you can open your hashtags in any way.

+2
source

Source: https://habr.com/ru/post/891040/


All Articles