I am trying to make a UITextView to have two links in it as text, but with different colors. I am not sure if it's possible at all.
I have set the UITextView to detect links, not to be editable, but only selectable.
What I did so far is the following:
NSMutableAttributedString *termsAndConditionsTitle = [[NSMutableAttributedString alloc] initWithString:@"I have read the " attributes:@{NSLinkAttributeName: @"https://apple.com", NSForegroundColorAttributeName: [UIColor greenColor]}];
NSMutableAttributedString *someString2 = [[NSMutableAttributedString alloc] initWithString:@"terms and conditions" attributes:@{NSLinkAttributeName: @"https://microsoft.com", NSForegroundColorAttributeName: [UIColor redColor]}];
[termsAndConditionsTitle appendAttributedString:someString2];
[self.termsAndConditionsView setAttributedText:termsAndConditionsTitle];
But in the end the links just have the tint color of the UITextView. Is it possible to make the two link have different colors? Thanks in advance!
P.S. I don't want to use libraries/frameworks if possible.