PJR
PJR

Reputation: 13180

UILabel with Link with more than one line

i want to use UILabel with link.

for that i am using IFTweetLabel which is finding any link and showing a line under it and it is clickable.

but if a string is big then only first line is getting hyperlink instead of complete URL.

as an issue with https://github.com/clawoo/IFTweetLabel/issues/3.

so is there any other option for it , or other library ?

Upvotes: 1

Views: 848

Answers (4)

dhaval rupani
dhaval rupani

Reputation: 542

First you have to import RegexKitLite framework. Go through this link. Surely this will help you. It gives same thing as you want.

http://furbo.org/stuff/FancyLabel_1.0.zip

Upvotes: 3

AppleDelegate
AppleDelegate

Reputation: 4249

what is the reason for not using UITextView..there is link detection property for UITextView.Your app is not going to get rejected

Upvotes: 0

Suresh Varma
Suresh Varma

Reputation: 9740

First thing I would like to suggest is

Use UITextView with editing property as NO and it will automatically detect all the links separately similar like the one you need.

textview.editable = NO;
textview.dataDetectorTypes = UIDataDetectorTypeAll;

If you still want to go with UILabel then

You can achieve this by using NSArrtibutedStrings — but I would recommend to use some wrapper around this C-functions. I like OHAttributedLabel.

The demo included shows exactly, how hyperlinks can be handled.

Upvotes: 1

Maulik
Maulik

Reputation: 19418

You should give a try to three20 project.

Upvotes: 0

Related Questions