NSString *str = @"We’ll notify you before we make changes to these
terms and give you the opportunity to review and comment on the revised
terms before continuing to use. If you have any question just email
me.";
NSMutableAttributedString *aStr = [[NSMutableAttributedString
alloc]initWithString:str attributes:nil];
[str rangeOfString:@"email"]];
[self.textView setAttributedText:aStr];
Asked
Active
Viewed 1,215 times
0

Inder_iOS
- 1,636
- 1
- 12
- 20
-
You should try this: http://stackoverflow.com/questions/26962530/hyperlinks-in-a-uitextview – nynohu May 11 '17 at 06:03
2 Answers
2
you can do something like,
NSString *str = @"We’ll notify you before we make changes to these terms and give you the opportunity to review and comment on the revised terms before continuing to use. If you have any question just email me.";
NSMutableAttributedString *aStr = [[NSMutableAttributedString alloc]initWithString:str attributes:nil];
[aStr addAttribute:NSLinkAttributeName value:@"Your Link here" range:[str rangeOfString:@"email"]];
[self.textView setAttributedText:aStr];
Update
You can add font attribute to make it bold. For example if you want to make We’ll notify
bold then
[aStr addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:14.0] range:[str rangeOfString:@"We’ll notify"]];
add this line before you set attributed text to your textView
!

Ketan Parmar
- 27,092
- 9
- 50
- 75
-
-
-
Suppose i want to bold some text on this string, then how i will do this – Inder_iOS May 11 '17 at 07:22
0
Add this property to your textview
textview.dataDetectorTypes = UIDataDetectorTypeLink;

Nupur Sharma
- 1,106
- 13
- 15