Discussion:
Custom keyboard with search bar not behaving
Steve Mills
2018-08-20 13:16:05 UTC
Permalink
I guess I'll try this list as well.

I’m implementing a custom keyboard for iOS. It contains a UISearchBar the user can use to filter the “keys” they can use to type. When the search button is used, I call [searchBar resignFirstResponder] to have the search bar give up its capture of input. The insertion point has been and still will be blinking in the document view, yet calling [self.textDocumentProxy insertText:s] no longer inserts text into the document.

I thought this was working earlier in the project development. Any ideas? I see a similar feature working in Google's Gboard. Maybe I need to use a fake search bar so the text input chain never gets disturbed?

BTW, I've only tested from the Simulator available on my work Mac, which is still maddeningly stuck on macOS 10.10.

--
Steve Mills
Drummer, Mac geek

_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sen
Saagar Jha
2018-08-20 18:35:18 UTC
Permalink
What does [UIApplication.sharedApplication.keyWindow performSelector:@selector(firstResponder)] give you?

Saagar Jha
Post by Steve Mills
I guess I'll try this list as well.
I’m implementing a custom keyboard for iOS. It contains a UISearchBar the user can use to filter the “keys” they can use to type. When the search button is used, I call [searchBar resignFirstResponder] to have the search bar give up its capture of input. The insertion point has been and still will be blinking in the document view, yet calling [self.textDocumentProxy insertText:s] no longer inserts text into the document.
I thought this was working earlier in the project development. Any ideas? I see a similar feature working in Google's Gboard. Maybe I need to use a fake search bar so the text input chain never gets disturbed?
BTW, I've only tested from the Simulator available on my work Mac, which is still maddeningly stuck on macOS 10.10.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent
Steve Mills
2018-08-20 18:49:49 UTC
Permalink
It correctly shows it to be the UITextView I currently have in the wrapper app, both before and after I activate and cancel the search bar. It seems like the UIInputViewController's textDocumentProxy isn't handling the change in input views properly.

Steve via iPhone
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.net

Loading...