Reputation: 13
I'm making a app with mutiple view controllers, one moves on to the next and once the user moves on to the next view there is no need to go back.
I have created the .m .h files for the view controllers that I need to play sounds on.
What I would like help with is disabling copy/paste/define in UITextview which I know how to do (and works fine) using
@interface MyUITextView : UITextView {
}
@end
@implementation MyUITextView
- (BOOL)canBecomeFirstResponder
{
return NO;
}
Is there a way of using this code once with out creating .m .h files for each and every uiveiwcontroller? Or will Xcode allow me to assign the same name to more than one uiveiwcontroller and use the same piece of code?
Is it possible to write it into the AppDelegate for every UITextview on different controllers?
Thanks for any help in advance :)
Upvotes: 0
Views: 102
Reputation: 31016
You don't have to duplicate any code. If you're making your UI using xib files or a storyboard, just set the class name of any text views that you want to have behave this way to MyUITextView
in Xcode's Identity inspector.
Upvotes: 1