title: How do I add a custom contextual menu item to UITextView using Swift?
body: <p>I managed to subclass UITextView and disabled the "Define" contextual menu item.</p>
  
  <pre><code>class TextViewer: UITextView {
  
     // Overide, disable the "Define" contextual menu item
     override func canPerformAction(action: Selector, withSender sender: AnyObject?) -&gt; Bool     {
         if action == "_define:" {
             return false;
         }
         return super.canPerformAction(action, withSender: sender)
     }
  
  }
  </code></pre>
  
  <p>But now, how do I add a different/custom menu item to take its place?  I was guessing it might be something like this, but it's not quite right.</p>
  
  <pre><code>var menuController = UIMenuController.sharedMenuController()
  var customMenuItem = UIMenuItem(title: "Lookup", action: "lookupWord")
  menuController.menuItems?.append(customMenuItem)
  </code></pre>
  
  <p>Thanks for any help you folks can give me. ;-)</p>