ответ

0

Подкласс UIInputView. В вашем подклассе настройте .

protocol MyCustomInputViewDidChangeDelegate { 
    func customInputViewDidChange(customInputView: MyCustomInputView) 
} 

class MyCustomInputView: UIInputView { 
    var delegate: MyCustomInputViewDidChangeDelegate? 
} 

Вы должны UIInputViewController соответствовать MyCustomInputViewDidChangeDelegate Когда пользовательская клавиатура прикосновения, проповедуете, что делегат, когда соответствующего по телефону delegate?.customInputViewDidChange(self).

0

есть UITextFieldTextDidBeginEditingNotification, UITextFieldTextDidEndEditingNotification, UITextFieldTextDidChangeNotification Вы можете использовать

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(self.textFieldDidChanged(_:)), name: UITextFieldTextDidEndEditingNotification, object:self.txtAlbumName) 

    NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(self.textFieldDidChanged(_:)), name: UITextFieldTextDidChangeNotification, object:self.txtAlbumName) 
    // ------------ 

    func textFieldDidChanged(sender:NSNotification) -> Void { 

    } 

    func textFieldDidChanged (sender:NSNotification) -> Void{ 

    } 
}