ios - Why is textInput.keyboardType nil in textDidChange? -
The
I'm developing a custom keyboard Swift and I would like to know when the keyboard type of change (a number or decimal For example keyboard type) I believe this should be done in either its textDidChange or
textWillChange . This method gets a
UITextInput , which has a property
keyboardType . But when this method is called, that property is always happening
zero because it runs the following code, even after I have entered a different input type (number).
override function textDidChange (TextInput: UITextInput) {if the inputType = textInput.keyboardType {// here is never deleteKeyboardButton.backgroundColor = UIColor.yellowColor ()}}
keyboardType property, no
text
var proxy as = self.textDocumentProxy UITextDocumentProxy if proxy.keyboardType == UIKeyboardType.EmailAddress {// email add code here to display Input}
Comments
Post a Comment