tags:

views:

388

answers:

1

Hello, i want to disable text selection on a UITextView. Until now what i've already done is:
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
[UIMenuController sharedMenuController].menuVisible = NO;
if (action == @selector(paste:))
return NO;
if (action == @selector(select:))
return NO;
if (action == @selector(selectAll:))
return NO;
return NO;
}

In this away i set UIMenuController to hidden and i put a stop to text copy but the text selection is still visible. Google results (also stackoverflow) take me to no solution. Has someone already faced the same problem? Any ideas? Thanks in advance, marcio

A: 
Danilo Campos
Thank you Danilo but i've to display a very long text and I have to use UITextView 'cause I need to remember contentOffset. Everything could be done with UIWebView by setting: -webkit-user-select: none Unfortunately this can not be done in a public (allowed) way. need to find a way
marcio
Got a solution! return No in canBecomeFirstResponder :)
marcio
Oh, duh, shouldn't answer SO when tired. Mis-read, thought I saw UITextField. Good to know the answer on this one.
Danilo Campos