iOS Keyboard extension - adding buttons to standard keyboard (system-wide input accessory view) - ios

Based on docs I know that I can implement a custom system-wide keyboard by implementing keyboard extension.
However, when working only in application scope, we are recommended to use custom input views. In app-scope, we have an option to implement just an input accessory view, in case we just want to add a couple of buttons to a standard keyboard.
Now I am standing before a task in which seems I would very much benefit from something like a system-wide accessory input view. I need only to add a couple of buttons to the standard keyboard, but it needs to be accessible in system wide scope. The only way to get it seems to be implementing my own custom keyboard extension in which I would need to lay out and implement the full fledged keyboard, and then add those custom buttons on top of it. But I would very much like to avoid implementing my own "standard" keyboard and just piggy-back either on standard keyboard (using something like system-wide keyboard). Is there a standard way to do it?

So far it seems the fastest way would be taking one of the open source keyboards mimicking the standard keyboard, e.g., Tasty Imitation Keyboard, and modifying it to my own needs. It would be better than having to reimplement the whole keyboard on my own, yet, I would still like to find a way how to extend the standard keyboard.

Related

Editing a Keyboard in iOS

In terms of application for iOS coding, how can you manipulate the pre-existing keyboards? I want to change a button on the keyboard (for example, the A button on the English key board) to a custom image and custom output.
So I guess what I'm asking is: if and how you can access a pre-existing keyboard and if you can change the output of one of the keyboard buttons to a custom image which others will see if you send it to them?
Can't be done. There is no way to alter standard keyboards. You can add toolbars above them (via inputAccessoryView), you can't alter the actual keyboard.
You would need to create your own custom keyboard.

How to set a custom keyboard for UIWebView

How to show a custom keyboard and Input Accessory View for a editable UIWebView for iOS7 and up.
i.e: How can i set and make use a value from [UIWebView setInputView:] and [UIWebView setInputAccessoryView:]
It would be helpful to understand what you're trying to do? You can either be trying to force a specific type of keyboard such as numeric, email, etc. that will use the keyboard the user has explicitly installed on their device (or the system one).
In order to do this, you can reference this apple doc which shows you the 'type' attribute to add to an tag.
Otherwise you are asking about loading a custom keyboard that you have created from the webview. The app developer in me screams, "you should NEVER do this." If you're content is generic enough to merit putting into a webview, than it is certainly not worth loading a custom keyboard.
If you realllly need to do this, you can set keyboardDisplayRequiresUserAction to NO, then use custom javascript to request the app to perform a native function, then drop a uitextfield or uitextview directly overtop the html input field and set a custom input view on the native control. There are an obscene amount of problems with following this approach, and I sincerely hope you
Are you trying to customize the ios keyboard or you want to show an HTML keyboard?
In the first case you can look at this link: link
In the second case you can just google for it, this is the first result searching for "html keyboard".
Good luck
I believe there is no way to do this as of now. Hence, my current approach is to use a custom view below the keyboard and hide the keyboard and show the keyboard as required.

IOS 8:custom Keyboard with undo and redo button

I have developed an IOS 8 custom keyboard. I want to give it "undo" and "redo" functionality, like the default system keyboard. I have tried it in different ways but was unable to find a good solution.
We can interact with a Text Input Object textDocumentProxy with the methods
insertText
deleteBackward
documentContextAfterInput
ocumentContextBeforeInput
But I was unable to find any way of implementing "undo" and "redo" functionality.
I think we can NOT implement these function (undo,redo)
According to https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html
Because a custom keyboard can draw only within the primary view of its
UIInputViewController object, it cannot select text. Text selection is
under the control of the app that is using the keyboard. If that app
provides an editing menu interface (such as for Cut, Copy, and Paste),
the keyboard has no access to it. A custom keyboard cannot offer
inline autocorrection controls near the insertion point.
I think there are many case that content of textfield changed and you can not know when it changed, how it changed. If we can not know, we can not know to undo to where too. I think so.
I'm developing Custom keyboard extension like you and I have many problems. (eg: how can we know the current cursor to get current text selection...)
My question: Current text selection in CustomKeyBoardExtension (hope somebody know)

How can I get the size of the keyboard on iPhone?

I want to get the keyboard size without using NSNotification. When I press the plus button, it can replace the keyboard with a custom UIView like this:
Then the plus button is pressed and the view loaded:
How can I achieve this?
I already made same rookie mistake like you want to do here. The problem is you will write a lot only to realize you do not want to avoid standard flow provided you by iOS team. For example you will definitely have a bad time dealing with issue like this one (there is additional bar which is part of standard keyboard for Chinese locale):
I solved this by using other people's work from DAKeyboardControl project. You do not need to attach observer (or if you use DAKeyboardControl - block) directly to your bar with buttons, but to your controller and check what user is trying to do and animate this bar accordingly. In the sources you can see how to get keyboard's animation duration and timing function. It may sound more complicated than it indeed is, just give it a try.

Does apple allow any customized keyboards?

I'm sorry if this is a "duh" question, but this is sort of compounded with this. I've figured out that I need a custom view that basically mimics the virtual keyboard on the iPad, but with a different set of keys (like both numbers and letters). Here's the issue: this app is something that will be sold, so what I'm wondering is whether Apple allows custom keyboards that just mimic the regular keyboard.
Absolutely. As of iOS 4, you can set the inputView property of any UIResponder (like a UITextField) to your own custom view, and the system will display that view at the bottom of the screen in place of the system keyboard whenever that view gets first-responder status.

Resources