如何长按(放大镜出现)时如何在错误文本字段中禁用复制粘贴菜单

时间:2016-12-08 20:07:44

标签: cosmicmind

func canPerformAction(action:Selector,withSender sender:AnyObject?) - >布尔{         //禁用复制,全选,粘贴         if action == #selector(UIResponderStandardEditActions.copy( :))|| action == #selector(UIResponderStandardEditActions.selectAll( :))|| action == #selector(UIResponderStandardEditActions.paste(_ :)){             返回false         }         //默认         return super.canPerformAction(action,withSender:sender)     }

0 个答案:

没有答案