1. 覆盖父类同名属性
@protocol VVLTextViewDelegate;
@interface VVLTextView : UITextView
// warning1: Property type 'id<VVLTextViewDelegate>' is incompatible with type 'id<UITextViewDelegate> _Nullable' inherited from 'UITextView'
// warning2: Auto property synthesis will not synthesize property 'delegate'; it will be implemented by its superclass, use @dynamic to acknowledge intention
@property (nonatomic, weak) id<VVLTextViewDelegate> delegate;
@end
@protocol VVLTextViewDelegate <UITextViewDelegate>
- (void)test;
@end
@implementation VVLTextView
@endLast updated
Was this helpful?