I\'ve got a TextField with a numberPad and the function runs only if it contains numbers.
TextField
numberPad
The user will crash the app if they paste letters
For Swift 3 it's changed to:
override public func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { if action == #selector(copy(_:)) || action == #selector(paste(_:)) { return false } return true }