0

I have an UITextView. Magnifying glass will appear if I select some text. Magnifying glass may appear below UITextView. Is it possible to restrict magnifying glass boundaries?

enter image description here

Voloda2
  • 12,359
  • 18
  • 80
  • 130
  • You can also check [How disable Copy, Cut, Select, Select All in UITextView][1] [1]: http://stackoverflow.com/questions/1426731/how-disable-copy-cut-select-select-all-in-uitextview – Sakares May 03 '12 at 08:58

1 Answers1

0

You need to subclass the UITextView and override canPreformAction like this :

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
    BOOL can = [super canPerformAction:action withSender:sender];

    if(action == @selector(paste:) || action == @selector(selectAll:) || action == @selector(select:))
        can = NO;

    return can;
}

This is will prevent the UIMenuController To Appear .. but the magnify glass will still shown.

Malek_Jundi
  • 6,140
  • 2
  • 27
  • 36