Please find the following code which did not work for me.
@IBInspectable var pasteOption: Bool = true {
didSet {
func canPerformAction(action: Selector, withSender sender: AnyObject) -> Bool {
if action == "selectAll:" {
return pasteOption
}
if action == "select:" {
return pasteOption
}
if action == "cut:" {
return pasteOption
}
if action == "copy:" {
return pasteOption
}
if action == "paste:" {
return pasteOption
}
return super.canPerformAction(action, withSender: sender)
}
}
}
I want to disable cut, copy, paste on my UITextfield
using IBInspectable
.