Reputation: 13180
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
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
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
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