我正在尝试创建自己的自定义 UIScrollView,以便我可以将触摸事件从它传递给委托对象,该委托对象具有绘制到滚动视图内的图像视图的逻辑。
如果我从类接口中删除委托变量和属性,它可以作为普通滚动视图正常工作。当我将其设为我的自定义协议委托时,它会构建但不会传递消息..
任何帮助表示赞赏
@class DrawableScrollView;
@protocol DrawableScrollViewDelegate <UIScrollViewDelegate>
- (void)touchesBegan:(DrawableScrollView *)drawableScrollView touches:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(DrawableScrollView *)drawableScrollView touches:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(DrawableScrollView *)drawableScrollView touches:(NSSet *)touches withEvent:(UIEvent *)event;
@end
@interface DrawableScrollView : UIScrollView {
id<DrawableScrollViewDelegate> delegate;
}
@property (nonatomic, assign) IBOutlet id<DrawableScrollViewDelegate> delegate;
@end