title: Replace text with attributed text and add action to it
body: <p>I have array of strings <code>[apple,mango,banana,kiwi,orange]</code> 
  while the user is typing on textview if the last word is matched to any of the words in the array it should be underlined and have tap gesture added to it .
  I am using the </p>
  
  <pre><code>         func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -&gt; Bool { 
  let lastword = textviewtext.lastword()//i have last word i have to replace
  
          if myarray.contains(lastword) {
      //here code for replacing the text and underline it and add tap gesture 
      }
  </code></pre>
  
  <p>how to do this 
  exapmle - user if typed - " <strong>orange</strong> <strong>apple</strong> are good for health  " here the orange and apple should be underlined and should have tap enabled with some actions .like alert with "orange tapped" or "apple tapped"</p>