Custom keyboard with regular keyboards? - ios

I'm creating an app that uses a custom keyboard, now if I provide the default English keyboard using the same globe icon that iOS uses, it should be able to switch to the default English keyboard fine, but I'm not sure if the user can return back to my custom keyboard from the system keyboards (assuming the user has more than 1 keyboards).
Can someone please confirm if that would be possible?
Thanks

It's not. the system keyboards have no "switch to custom keyboard" button. They're not even aware you made a custom keyboard.
What is it you're trying to accomplish? Why are you building a custom keyboard? If you tell us, maybe we can suggest an alternate way to do what you need to do.

You should set an inputAccessoryView in your UITextView with a button to toggle between your custom and the standard keyboards.
Every time the user taps the button you change myTextView.inputView between your custom keyboard and nil, which restores the original keyboard.
https://developer.apple.com/library/ios/documentation/uikit/reference/UITextField_Class/Reference/UITextField.html#//apple_ref/occ/instp/UITextField/inputView
You'll also need to reassign first responder, and also try to animate it if you want:
Animating UITextInput's textInputView

What you need is making a custom keyboard check this:
App Extension Programming Guide

Related

Custom Keyboard on iOS

I need to create a custom keyboard for my app, but no sure the best way to do it without the user needing to add a keyboard in the settings. If I create a keyboard extension is it possible to set a UITextField's Keyboard Type to that custom keyboard? Or will I have to use a UIView to accomplish this?
For a custom keyboard that is specific to a single app, create a view and assign the view to UITextField.inputView:
textField.inputView = YourCustomKeyboard()
In my search I didn't find a way to tack on additional keys but there are examples of custom keyboards using inputView that are easy to adapt.
A custom decimal keyboard example
My hexadecimal keyboard version
You can add accessoryView to text view for you want to give a few extra buttons.
If you still looking for some more then please go through the below link.
https://www.cocoacontrols.com/search?utf8=%E2%9C%93&q=keyboard

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.

Editing keyboard layout in iOS

Is there a possibility to change the button layout on a pre-made ios keyboard?
I would like to add "done" and "punctuation" buttons to numeric keyboard.
There is the Decimal Pad available but in this case i would have to add a custom done button at the top.
Is there a way to move the "delete" button to the right and make it half of its current width, put next to it the "decimal" button and on the former place of "delete" locate "done"?
No, you'll have to implement your own keyboard, if you duplicate the Apple one it will get rejected.
iOS does not support making those types of changes to the keyboard, the only thing you can do is change the text associated with the Done/Enter button by changing the UIReturnKeyType of the associated UITextField.
You can make a View With the buttons you want and set the inputView to the custom view you made ,, and you got a custom keyboard :D
You cannot directly modify the keyboard other than by choosing one of apple's presets. However, it is possible to add additional keys above it using -inputAccessoryView, like WolframAlpha has done in its app.
It looks like you can replace the keyboard entirely, but the accesory view is probably the way to go. See the answer to Adding key to IPad keyboard
EDIT: For an example of how this would look, check out WolframAlpha's blog post on the subject. In your case the accessory view probably won't be quite so tall

How to programmatically change keyboard in iOS?

I would like to programmatically change keyboard when I click a button event.
I used custom keyboard in my app, but I need to change English (US) keyboard in programmatically when I click a button on my custom keyboard.
The only way you can control the keyboard is by showing it (By setting a UITextView/UITextField as a first responder), hiding it (by resigning the editing Easy way to dismiss keyboard?).
The language of the keyboard cannot be changed by your app, since it is a user preference. If you want a custom keyboard of your own, you would have to design it yourself (with UIButtons) and obviously also program it (when it shows, when it hides. I would simply use the keyboard that the user prefers, why do you need to change it? After all, the user is the one that decides which keyboard he uses.
I just got my answer for my own question.
Just put nil into inputView and that will change back into English (US) Keyboard.
You can change to the English (US) keyboard programmatically.
Try this:
textfield.secureTextEntry=YES;
textfield.secureTextEntry=NO;

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