简体   繁体   中英

Xcode How can I replace text with a hyperlink

I am a newbie to Xcode so please bear with me.

I have a requirement where I have a some text on my view which is loaded from API call to server. ( in short dynamic text populated runtime).

Now I need to replace all @blabla and #blablabla to clickable links / buttons or anything else. It should be clickable and on click of it, should open another view.

Please suggest if I should elaborate a bit more on this.

Here is the use case to be more specific

  1. View based application started
  2. Application calls a webserver (API) and receives text paragraph.
  3. It should show paragraph on screen but should replace @bla and @blabla with links and on click it should open another view ( not the webpage)

The cheater method is to use an Open Source component. I've not used it, but SMFancyText might do the trick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM