title: Make the text hyperlink or clickable in UITextView
body: <p>I am having the <code>UITextView</code> and displaying text in it from three tags(message, titleUrl and url). What i need is that i want to make the text of "titleUrl" clickable to open the value of "url" in web view. I managed to open the link directly from url, but i need to open the link by clicking "titleUrl". I have tried to achieve the following from this code.</p>
  
  <pre><code>[self buildAgreeTextViewFromString:NSLocalizedString(@"I agree to the #&lt;ts&gt;terms of service# and #&lt;pp&gt;privacy policy#", 
                                                   @"PLEASE NOTE: please translate \"terms of service\" and \"privacy policy\" as well, and leave the #&lt;ts&gt;# and #&lt;pp&gt;# around your translations just as in the English version of this message.")];
  </code></pre>
  
  <p>But i am not getting in this how to modify this to achieve the functionality. I want to enter the value have in string, don't have the static text to enter. Can anyone guide me to handle this?</p>
  
  <p>Update:</p>
  
  <pre><code>NSString *message = [NSString stringWithFormat:@"%@\n ", tempStr1];
          NSString *message1 = [NSString stringWithFormat:@"\n#&lt;pp&gt;%@#", titlStr1];
          NSString *localizedString = NSLocalizedString(message1, nil);
  
          NSRange ppRange = [localizedString rangeOfString:NSLocalizedString(message1, nil) options:NSCaseInsensitiveSearch];
  
  
          NSURL *ppURL = [NSURL URLWithString:strUrl];
  
  
  
          NSDictionary *attribute1 = @{NSForegroundColorAttributeName: [UIColor whiteColor],
                                       NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue" size:15.0],
                                       };
          NSMutableAttributedString *newAttString = [[NSMutableAttributedString alloc] initWithString:message attributes:attribute1];
  
          //
  
          NSMutableAttributedString *finalMessage = [[NSMutableAttributedString alloc] initWithString:localizedString];
          [finalMessage beginEditing];
  
          [finalMessage addAttributes:attribute1 range:ppRange];
          [finalMessage addAttribute:NSLinkAttributeName value:ppURL range:ppRange];
          [finalMessage endEditing];
  
          [newAttString appendAttributedString:finalMessage];
  
          self.txtView.attributedText = newAttString;
  </code></pre>