I have a UITextView subclass. UITextView class has some delegate protocols like
- (void)textViewDidChange:(UITextView *)textView;
- (void)textViewDidBeginEditing:(UITextView *)textView;
that I would like to use as they were from my custom class. In other words, if I use MyCustomTextViewClass from a class (lets call it classX), I have to do this and set the delegate:
MyCustomTextViewClass *box = [[MyCustomTextViewClass alloc] initWithFrame:
CGRectMake(111.0f, 123.0f, 190.0f, 50.0f)];
// ... bla bla.. set other parameters
[box setDelegate:self];
but in order to set the delegate, I have to declare classX using
<MyCustomTextViewClassDelegate>
and to do that, I have to add UITextView's delegate protocols to MyCustomTextViewClass.
How do I do that correctly?
simply do this on MyCustomTextViewClass?
@protocol MyCustomTextViewClassDelegate <NSObject>
@optional
- (void)textViewDidChange:(MyCustomTextViewClass *)textView;
- (void)textViewDidBeginEditing:(MyCustomTextViewClass *)textView;
@end
??? I don't see how this could forward the delegate protocols from the UITextView...
thanks for any help.