Search code examples
iphoneios8ios-app-extensioncustom-keyboard

Custom Keyboard: get text from input view


i have developed a custom keyboard app of iOS8. and i can't get the text from input view. any help will be appreciated . have tried to use

 - (void)textDidChange:(id<UITextInput>)textInput {} 

delegate to get text. but it returns null value. i don't have another idea from which i can get text from input view thanks in advance


Solution

  • i am able to get string from input view of custom keyboard of iOS 8 . here is the line of code which will return the string

        NSString *strBeforeCursor=[self.textDocumentProxy documentContextBeforeInput]; 
        NSString *strAfterCursor=[self.textDocumentProxy documentContextAfterInput]; 
    

    thanks