     var tapRecognizer: UITapGestureRecognizer!
     weak var delegate: MentionTapHandlerDelegate?
 
-    init(view: UIView, delegate: MentionTapHandlerDelegate) {
+    init<T: UIView where T: AttributedTextContainingView>(view: T, delegate: MentionTapHandlerDelegate) {
         super.init()
         self.delegate = delegate
         tapRecognizer = UITapGestureRecognizer(target: self, action: "viewTapped:")

    static let Encoded = "MentionEncodedAttribute"
}

///  The MentionController class provides a simple interface for rendering @mentions and #hashtag comments on UILabel, UITextField, and UITextView.
///  To handle user taps on an @mentioin or #hashtag you must conform to the MentionTapHandlerDelegate protocol and set the delegate on MentionController.
///  Note: MentionController is built to be compatible objective C.
public class MentionController: NSObject, MentionTapHandlerDelegate {

    var view: UIView
    weak var delegate: MentionTapHandlerDelegate?
    private var tapHandler: MentionTapHandler!
    private let mentionDecoder: MentionDecoder

    // MARK: Init

    public convenience init(label: UILabel, delegate: MentionTapHandlerDelegate?) {
        label.userInteractionEnabled = true
        let attributedString = label.attributedText ?? NSAttributedString(string: label.text ?? "", attributes: [NSFontAttributeName : label.font, NSForegroundColorAttributeName : label.textColor])
        self.init(view: label, inputString: attributedString, delegate: delegate)
    }

    public convenience init(textField: UITextField, delegate: MentionTapHandlerDelegate?) {
        let attributedString = textField.attributedText ?? NSAttributedString(string: textField.text ?? "", attributes: [NSFontAttributeName : textField.font!, NSForegroundColorAttributeName : textField.textColor!])
        self.init(view: textField, inputString: attributedString, delegate: delegate)
    }

    public convenience init(textView: UITextView, delegate: MentionTapHandlerDelegate?) {

        let attributedString = textView.attributedText ?? NSAttributedString(string: textView.text, attributes: [NSFontAttributeName : textView.font!, NSForegroundColorAttributeName : textView.textColor!])

        self.init(view: textView, inputString: attributedString, delegate: delegate)
    }

    private init(view: UIView, inputString: NSAttributedString, delegate: MentionTapHandlerDelegate?) {
        self.view = view
        self.delegate = delegate
        self.mentionDecoder = MentionDecoder(attributedString: inputString)

        // Decode
        let attributedStringWithMentions = mentionDecoder.decode()

        // Set Attributed Text
        self.view.m_attributedText = attributedStringWithMentions

        // Handle Taps
        tapHandler = MentionTapHandler(view: view, delegate: self)
