0

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.

3
  • are you using textfield for display this link or label .@Aditya Pandey Commented May 25, 2017 at 4:42
  • you can try stackoverflow.com/a/21630187/4970453. and. stackoverflow.com/a/19228078/4970453 Commented May 25, 2017 at 4: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 <a href=\"maximusautogroup.com\" target=\"_blank\">here</a> to know about our claim pr"; Commented May 25, 2017 at 4:50

1 Answer 1

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];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.