Here I have a custom UITextView. It shows many of the shortcuts that is not needed and also it shows wrong action, like when textview is empty it shows the "cut" "copy" "select" & "select all" action that is not required. Please refer to the screenshot for more clarity. Click here
Asked
Active
Viewed 216 times
3
-
Don't tell people to vote on your post, people will vote as they see fit. – JAL Feb 07 '17 at 16:12
1 Answers
1
Try this to disable the entire Select/Copy/Paste Menu in a UITextView
-(BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
[UIMenuController sharedMenuController].menuVisible = NO;
return NO;
}

Shahrukh
- 740
- 7
- 25
-
1For Swift 3 `override public func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { return false }` – Shahrukh Feb 07 '17 at 13:54
-
I don't want to disable the entire menu.I just want normal textview behavior. – Salman Ghumsani Feb 07 '17 at 14:05
-
http://stackoverflow.com/questions/1426731/how-disable-copy-cut-select-select-all-in-uitextview check this ans – Shahrukh Feb 07 '17 at 15:52