Get full string in iOS8 Custom Keyboard Extension

后端 未结 5 725
再見小時候
再見小時候 2020-12-25 08:34

I\'m creating a Custom Keyboard Extension for iOS 8.

I want to get the whole string that the user wrote in the text input field.

Unfortunately I stumble in t

5条回答
  •  再見小時候
    2020-12-25 08:43

    You could always have a mutable array you store all typed text in, and remove the last character when deleting(or maybe do some detection with documentContextAfterInput/BeforeInput to find the spot to delete text, then remove that portion). This is more complicated than just calling a 'giveMeWholeString' method, but it would work for most cases, especially if they were only typing and deleting with the delete key.

提交回复
热议问题