当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Is there any delegate method to get information when cursor in the UITextField or UITextView using keyboard extension is moved?

问题描述:

I want to handle a situation in my custom keyboard when the user moves the blinking cursor in the textview/textfield using my keyboard. I looked in to the apple's documentation of UIInputViewController and couldn't find any. Does anybody has an idea on how to do this?

P.S: This is a keyboard extension. In this we have KeyboardViewController which is subclass of UIInputViewController which implements "UITextInputDelegate". We have access to 4 delegate methods and none of them provides the required information. Is there any way to get information when cursor position changes:-

public func selectionWillChange(textInput: UITextInput?)

public func selectionDidChange(textInput: UITextInput?)

public func textWillChange(textInput: UITextInput?)

public func textDidChange(textInput: UITextInput?)

分享给朋友:
您可能感兴趣的文章:
随机阅读: