With iOS7, the protocol UITextInputTraits
gets new values for the enum UIKeyboardAppearance
.
In particular I'm interested in changing the keyboardAppearance
to UIKeyboardAppearanceDark
in order to match the current app dark design.
I first looked into the Info.plist but it seems that there isn't a key in that allows you to globally set this property.
My second thought was to use the UIAppearance but unfortunately the keyboardAppearance
doesn't have the UI_APPEARANCE_SELECTOR
decorator.
But for some reason this code:
[[UITextField appearance] setKeyboardAppearance:UIKeyboardAppearanceDark];
works on iOS7, but crashes in iOS6.
Even more strangely the following code:
[[UITextView appearance] setKeyboardAppearance:UIKeyboardAppearanceDark];
doesn't work in iOS7 nor iOS6.
A good idea can be to create a subclass of both UITextField & UITextView but in this way this doesn't work for example in UISearchBar.
I don't want to create a category because I don't want to sort-of-override the implementation of Apple classes and probably not been future proof.
Any one have ever dealt with this?