Just for clarification, itβs better to implement methods such as those defined in the protocol:
- (void)textViewDidBeginEditing:(UITextView *)textView
If you implement protocol methods with your custom class type or any class type, the methods will still be called because type checking is not performed. The parameter will actually be your custom subclass. In any case, and again for clarification, I suggest having an internal composition if you want to deal with the Ivars of your subclass:
- (void)textViewDidBeginEditing:(UITextView *)textView { MyTextView * myTextView = (MyTextView *)textView; ... }
source share