Skip to content

Instantly share code, notes, and snippets.

@jimmythai
Created January 9, 2019 08:48
Show Gist options
  • Select an option

  • Save jimmythai/7da6a1d252e2f7817cf87bfab6ab2003 to your computer and use it in GitHub Desktop.

Select an option

Save jimmythai/7da6a1d252e2f7817cf87bfab6ab2003 to your computer and use it in GitHub Desktop.
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
let isDisabledAction = action == #selector(copy(_:)) || action == #selector(cut(_:)) || action == #selector(paste(_:))
return isDisabledAction ? false : super.canPerformAction(action, withSender: sender)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment