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.

1 Answers1

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