xamarin ios set installed keyboard as inputview - ios

I am trying to set an installed keyboard as the default input for a UITextField. Imagine you have a custom emoji keyboard called "AwesomeEmojis" and you want that keyboard to be the default keyboard programmatically . I have this code:
NSObject[] installedKeyboards = NSUserDefaults.StandardUserDefaults.ArrayForKey("AppleKeyboards");
I am able to see the list of keyboard in a NSMutableString format like:
"awesomeemoji#sw=AwesomeEmoji"
Is there any way that i can do something like:
AwesomeTextField.InputView = FromSystemKeyboards["awesomeemoji#sw=AwesomeEmoji"];
Please keep in mind the it's not a system keyboard. It's installed keyboard.
Thanks!

Related

Show Emoji keyboard programatically in iOS 9.0

I have a textfield where i need the user to select an emoji to proceed. How do i trigger the emoji keyboard by default?
I know there is a way to get all keyboards but i am not sure how to select one by default.
NSArray *array = [[NSUserDefaults standardUserDefaults] objectForKey:#"AppleKeyboards"];
NSLog(#"Keyboards: %#", array);
The output of all the installed international keyboards looks as follows:
Keyboards: (
"en_US#hw=US;sw=QWERTY",
"zh_Hant-HWR#sw=HWR",
"emoji#sw=Emoji"
)
I am supporting only iOS 9.0, so i am ok with assuming the user has an emoji keyboard.
It can be done by sub-classing UITextField and return the proper mode value for textInputMode.
See this answer:
change the keyboard layout to emoji
it seems that you cannot do this, iOS does not provide any public api to programatically switch to another input method, and emoji keyboard is regarded as a kind of input method.

Programmatically detecting / changing custom keyboards

Is there any way to programmatically detect installed keyboards and/or change the keyboard to a custom keyboard from within your app? As in, if I wanted to show a toolbar above the text keyboard with shortcut buttons to commonly-installed custom keyboards, could I a) detect the keyboard is installed, and b) change to a given keyboard on tap?
This assumes you want the list of keyboards setup in the Settings app under General, Keyboards.
You can determine the primary keyboard:
UITextInputMode *currentMode = [[UITextInputMode activeInputModes] firstObject];
You can determine the possible keyboards
NSArray *possibleModes = [UITextInputMode activeInputModes];
You can determine when the keyboard changes. This is done by listening for the UITextInputCurrentInputModeDidChangeNotification notification.
However, there is no API to change the keyboard.
So you can do everything you need except the most important part.

Qwerty Azerty in custom keyboard ios swift

Is it possible to Add Qwerty and Azerty in custom keyboard for iOS
I have a file DefaultKeyboard.swift and i tried to add anything like AzertyKeyboard.swift
Thank you on avance
Apple requests that each keyboard language is added in a UIInputViewController of its own. De-facto, all the keyboards are changing languages inside the same UIInputViewController by replacing the layout or keyboard map.
You can choose either way.

How can I change some keystroke on iOS 7 default keyboard? Like Slack

I use an app called "Slack" somehow they managed to change the return key to be "#" and "#" like in the picture.
I really don't know whether they created a whole new keyboard view that look exactly the same as iOS default keyboard or
It has a way to custom the return button of the default keyboard.
Anyone got any idea how can they do this on iOS 7?
Slack has shared it source code for handle message like app here
Which I still cannot locate where is the functionality to add "#" and "#"
You can achieve this by using the Twitter keyboard built in to the iOS SDK.
[textField setKeyboardType:UIKeyboardTypeTwitter];
If you're using Interface Builder, select your UITextField and go to the Attributes inspector -> Keyboard Type -> Twitter.

keyboard language button in UITextView

Just noticed that in UITextView keyboard comes without change language button, unlike in UITextField. Why Apple removed this button from UITextView keyboard? Is there any way to enable this button? I want people to be able to write notes on any keyboard language added in phone settings.
EDITED: Maybe it will help somebody in the future. Just noticed that I set keyboard type to UIKeyboardTypeAlphabet and this option eliminates language button. Closing this question.
P.S. I have 3 languages enabled in test iPhone.
You are completely wrong. there is no difference in UIKeyboard in iOS whatsoever. It only depends on what keyboard types you use.
UIKeyboardTypeDefault and UIKeyboardTypeEmailAddress and UIKeyboardTypeTwitter all have those.
You set it like this:
txtField.keyboardType = UIKeyboardTypeTwitter;
UIKeyboardTypeDefault is obviously the default one for any UITextView or UITextField in iOS.
For anyone have this problem even when using UIKeyboardTypeDefault on a UITextView, go into the storyboard and make sure "Secure Text Entry" is unchecked. After unchecking this, the keyboard selector will return as well as the quick type keyboard.

Resources