I Am getting a string from API which is "http://www.maximusautogroup.com/\" target=\"_blank\">here". From this string I have to show "here" as an hyperlink of that link. i am not getting how to do that.
Asked
Active
Viewed 79 times
0
-
are you using textfield for display this link or label .@Aditya Pandey – Vinod Kumar May 25 '17 at 04:42
-
you can try https://stackoverflow.com/a/21630187/4970453. and. https://stackoverflow.com/a/19228078/4970453 – Varinder Singh iPhone Dev May 25 '17 at 04:49
-
I am using textview .... and the complete string I am getting is "Our official working hours are 9 am to 6 pm ET. We will get back to you on next working day. Please visit here to know about our claim pr"; – Aditya Pandey May 25 '17 at 04:50
1 Answers
0
Try this:
NSString *FileName = [[Url lastPathComponent] stringByDeletingPathExtension];
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:FileName];
[attributeString addAttributes:@{NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle)
, NSBackgroundColorAttributeName: [UIColor blueColor]} range:NSMakeRange(0, [attributeString length])]
[_buyButton setAttributedTitle:attributeString forState:UIControlStateNormal];

Ajjjjjjjj
- 669
- 4
- 12