In objective-C I use this code for adding Done key to keyboard
[textField setReturnKeyType:UIReturnKeyDone];
How to set Done key in keyboard in swift-language?
in swift this code gives error 'not have a member named setReturnKeyType'
textField.setReturnKeyType
You directly assign the value to the returnKeyType property.
textField.returnKeyType = UIReturnKeyType.Done
In Swift, you access the individual items in the enum with a dot syntax. This can also be shortened further to:
textField.returnKeyType = .Done
You can do it like that:
textField.returnKeyType = UIReturnKeyType.Done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With