I have created a custom text input view and am trying to force the keyboard to show all caps on the keyboard; similar to a UITextField. Here is what I have tried, but it isn't working for me:
class CustomInput: UIView, UIKeyInput {
// UIKeyInput inherits this property
var autocapitalizationType: UITextAutocapitalizationType {
get { return .AllCharacters }
set { }
}
}
I hoped that overriding the variable and only allowing .AllCharacters would force the keyboard to all caps, but that isn't the case. Any ideas how I can get the keyboard to all caps?
I have this same problem in an app I'm currently working on. Have spent a fair amount of time trying to figure this out, especially since
autocorrectionTypeandkeyboardTypeboth seem to work fine.My current work-around is to make my custom view implement
UITextInputinstead ofUIKeyInput, with dummy code for all unused properties and functions. Extremely ugly work-around but it's the only way I can get it to work, so I'm running with it.Would be interested to see if anyone has insight into the underlying issue here.