Tutorial by Examples

Here is an example of custom UITextField that takes only numerical text and discards all other. NOTE: For iPhone it is easy to do this using Number type keyboard, but for iPad there is no keyboard with Numbers only class NumberTextField: UITextField { required init(coder aDecoder: NSCoder) ...
If we want to disable all the actions like Copy, Paste, Replace, Select, etc from UITextField then we can use following custom text field: class CustomTextField: UITextField { var enableLongPressActions = false required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder)! } o...

Page 1 of 1