Would it be OK to add a custom button on a system keyboard in iPad - ios

I have a requirement wherein I have to change the text of the return key of the iPad to Sign-in. Obviously it is not one of the options available in the sdk. I have searched it over the net and it seems doing that possible.
The only question remaining is whether the app would be accepted by Apple if I modify the default system keyboard? The HIG is not clear on this , it states that "A custom input view can replace the system-provided onscreen keyboard in apps" and "You can also provide a custom input accessory view, which is a separate view that appears above the keyboard (or your custom input view)". Nothing about whether we are allowed to add an extra button on a system keyboard.
Any experiences??

#Vin you can change the name of return key of the keyboard to your requirement. I have an app that has the changed to return key name to Done and Search. And apple did not reject it.

To "Sign-In" you can use the return key UIReturnKeyJoin
textField.returnKeyType = UIReturnKeyJoin;
EDIT
Nope. You get the return key and
keyboard types defined in the OS.
Unless you want to try to hack the
keyboard's view hierarchy to change
that button, which would be a really
bad plan. (Standard recommendation
here is to file a bug report with
Apple to let them know you'd like
more/different options.)
see Custom iPhone return key text

Since I didn't get any satisfactory answer, I convinced the client that it would be inappropriate to modify the default system keyboard for a sake of one button(even if it is allowed by Apple). We are now going for the "Go" option available for return key.

Related

How can I get the current SIM number in iPhone?

I know that unlike the operator name and the country code, it's not possible to get the user's phone number in iOS programmatically (at least not with publicly available APIs).
But I have just tried the app Lyft and it is autosuggesting my current phone number. I want to know how this app is doing that.
The phone number suggestion appearing above the keyboard is a built-in iOS feature and it works if a Text Content Type is set for a UITextField.
Since iOS 10, you can provide a content type for your inputs. iOS then will recommend autofill options for the given content type.
You can set up a content type...
in Interface Builder by navigating to the Text Input Traits section of the Attributes inspector (the fourth icon from the right in the top sidebar):
...or programmatically with:
textField.textContentType = .telephoneNumber

Detect Whether Numeric Keyboard Has Return Key or Not

On iOS, the numeric keyboard has a return key on iPad but not on iPhone.
I am taking the standard approach of adding a toolbar as inputAccessoryView of the target text field, with a "Done" button in it.
However, on iPad the keyboard already has a return key (labelled "Done", "Next", etc. according to one of the constants enumerated in UIReturnKeyType); I would like to display the accessory view only when necessary.
Is there a way to detect the presence of such key, other than the (inelegant) method of querying the user interface idiom?
I ask this because, the fact that the iPad keyboard has a return key and the iPhone one does not seems like an implementation detail, in principle unrelated to whether the device is a phone or a tablet. As such, it feels like it might change in the future, breaking my (unrobust) solution.

iOS Custom Keyboard Types

I'm worked on a custom keyboard and Apple review team rejected it because the keyboard does not support 'Numbers and Decimals' types.
So, I found that the problem is that when a text field requires those specific type of keyboard (for example to inset age, measures, or other numeric values), my keyboard 'misses to respond'.
I understood, reading from Apple documentation, that you must respond to the UIKeyboardTpye property per text object's.
I searched for specific delegate of the UIInputViewController but I wasn't able to find something close to that.
In this forum I found that one good place to examine the current keyboard type required is the textDidChange: delegate, but, it is not called.
I suppose this responder is called when your keyboard, somehow, 'declares' to iOS that it can handle Numbers or Decimal types. In fact I created a simple app with a simple UITextView that requires the Decimal keyboard type:
textView.keyboardType = UIKeyboardTypeDecimalPad;
And I put a NSLog() in the keyboard extension Input View Controller textDidChange: delegate.
As I tap on the text view my delegate is not called, instead the standard Decimal keypad is shown and in the Xcode console I see the following message:
Can't find keyplane that supports type 8 for keyboard iPhone-Portrait-DecimalPad; using 405786210_Portrait_iPhone-Simple-Pad_Default
I noticed also that this message comes when the UITextView requires the not-allowed keyboard types, i.e. the phonepad. All other keyboard types do not issue that message and the custom keyboard is shown and the textDidChange: delegate is correctly called.
The Numbers and Decimal types are surely allowed and are a MUST for the review team guys. Why the behave as a forbidden-types?
I think we need to 'declare', for example in the info.plist that our extension supports various keyboard types, but... well or more simply... I do not get the point... so... I'm asking... How can I add multiple keyboard types to my keyboard extension??
Thank you very much for help!
After the second rejection of my keyboard extension they sent me a screenshot. I noticed that they, generally, test apps on iPad. This made me think.
After some test it came out that the Numbers and Decimal types do not respond the same way on iPhone and iPad.
On iPhone a text view requiring Numbers or Decimal type keyboard always shows the iOS keypad, i.e. the custom extension is not called.
On the other side, on the iPad a text view requiring Numbers or Decimal type keyboard activates the custom extension.
Finally, after provided a standard numeric keypad (even if my keyboard uses hand-written techniquies) it was approved.

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.

Capitalization of UITextField

Open up Apple's Calendar app. When you name a new appointment, it automatically capitalizes the first letter. It does not use the 'correction' style swap-out to do this.
For the life of me I can not reproduce this behavior. In IB I have set the UITextField's Capitalization to Word, but it seems to have no effect at all. If I turn on correction, it will swap-out the word with a capitalized version, but this isn't quite right.
Do I need to handle this in code, by checking each key press? This is probably trivial, except I'm worried about all of the corner cases I will miss, such as when the user manually uses 'shift' to negate the capitalization, or deletes and re-keys, in which case it shouldn't capitalize.
Or maybe there's a way to simply load the textfield with shift pressed? Is this the common way of implementing it?
Setting the capitalization to Word should do this, so something else is going wrong. Are you certain that's toggled on the actual UITextField that you're testing? Are you sure you're not maybe overriding it in code somehow? You can set it programmatically with:
[myTextField setAutocapitalizationType:UITextAutocapitalizationTypeWords];
There's also an exception (per the docs) where this will be ignored:
Some keyboard types do not support auto-capitalization. Specifically,
this option is ignored if the value in the keyboardType property is
set to UIKeyboardTypeNumberPad, UIKeyboardTypePhonePad, or
UIKeyboardTypeNamePhonePad.
Does this apply to you?
Are you using the simulator or an actual device? If you are using the simulator, the casing will respect the shift and caps-lock state of the physical keyboard on your computer.
i just checked this in my app and it already did Capitalization by default. the behaviour is not determined by your application code, but by the global iphone settings.
start the iOS Settings. go to General, then Keyboard, there the user has the option for "Auto-Capitalization". is it off ?
in my case it was turned on, so my app and the calendar had this feature, when i turn it off, both apps are lacking this feature, because the user decided he does not want this feature.
Capitalization disable
textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
To capitalize all characters
textField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
To capitalize first character of sentence
textField.autocapitalizationType = UITextAutocapitalizationTypeSentences;
To capitalization of first character of all words in sentense
textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
Certain keyboards ignore the capitalization type
Some keyboard types do not support auto-capitalization. Specifically, this option is ignored if the value in the keyboardType property is set to UIKeyboardTypeNumberPad, UIKeyboardTypePhonePad, or UIKeyboardTypeNamePhonePad.
More details on the developer reference
Here is a Swift 2.0 update for all characters:
SomeTextField.autocapitalizationType = UITextAutocapitalizationType.AllCharacters
I had the same issue with capitalization property, i just changed keyboard type to Default and everything start working as expected. In my case i had previously set keyboardType to NamePhonePad that don't support auto-capitalization.

Resources