Single extension for UITextView and UITextField in Swift
<p>I want to create a single <strong>extension</strong> for both <code>UITextField</code> and <code>UITextView</code> and add a below method to it:</p>

<pre><code>    func addDoneButtonOnKeyboardWith(selector : Selector)
    {
        let keyBoardToolBar = UIToolbar(frame: CGRect(x: 0, y: 0, width: 320, height: 30))
        let barButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: nil, action: selector)
        let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
        keyBoardToolBar.items = [flexibleSpace, barButtonItem]
        keyBoardToolBar.barStyle = .default
        self.inputAccessoryView = keyBoardToolBar
        self.reloadInputViews()
    }
</code></pre>

<p>I want the extension method to be available only for <code>UITextField</code> and <code>UITextView</code>.</p>