答えて

0

サブクラスUIInputView。サブクラスでを設定します。

protocol MyCustomInputViewDidChangeDelegate { 
    func customInputViewDidChange(customInputView: MyCustomInputView) 
} 

class MyCustomInputView: UIInputView { 
    var delegate: MyCustomInputViewDidChangeDelegate? 
} 

あなたは、あなたのカスタムキーボードをタッチするとUIInputViewControllerMyCustomInputViewDidChangeDelegateに準拠しています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{ 

    } 
} 
関連する問題