1

How can I subclass UITextView in UIActionSheet to overwrite canBeforeFirstResponder to disable copy, select, and select all in UITextView.

#import <UIKit/UIKit.h>

@class English;

@protocol EnglishDelegate

- (void)dismissViewDidFinish:(UIViewController *)viewController;

@end


@interface English: UIViewController <UITextViewDelegate, UIScrollViewDelegate>


{
id<EnglishDelegate> delegate;
UITextView *textView;
UINavigationBar *navBar;
UINavigationController *navigationController;

}

@property (nonatomic, retain) UITextView *textView;
@property (nonatomic, assign) UINavigationBar *navBar;
@property (strong, nonatomic) UINavigationController *navigationController;
@property (nonatomic, assign) id<EnglishDelegate> delegate;
@property (nonatomic, retain) UIScrollView *scrollView; 

-(void)dismissView:(id)sender;

@end

Anyone knows how to subclass it in h file.

Thanks for help.

user1120133
  • 3,244
  • 3
  • 48
  • 90
  • 1
    possible duplicate of [How disable Copy, Cut, Select, Select All in UITextView](http://stackoverflow.com/questions/1426731/how-disable-copy-cut-select-select-all-in-uitextview) – Evan Mulawski May 13 '12 at 00:05

1 Answers1

2

You wouldn't subclass UITextView inside of another class; you would just plain subclass it in another file and override the canBecomeFirstResponder as so:

- (BOOL)canBecomeFirstResponder {
    return NO;
}
Carter Pape
  • 1,009
  • 1
  • 17
  • 40