uiscrollview subclass
just creating a subclass of uiscrollview here and im trying to catch a -(void)scrollViewDidScrollUIScrollView *)scrollView{} in it but for some reason it is not registering.
@interface WallScrollView : UIScrollView{
}
@end
@implementation WallScrollView
-(id)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
self.userInteractionEnabled = YES;
return self;
}
-(void)scrollViewDidScroll:(开发者_如何学编程UIScrollView *)scrollView{
//some ultra fancy code
//this code is not called for some reason
}
-(void)dealloc{
[super dealloc];
}
@end
any ideas as to what im missing or doing wrong here? basically want to catch viewdidscroll. thanks
You do not need to subclass the UIScrollView
. Simply implement the - (void)scrollViewDidScroll:(UIScrollView *)scrollView
method in your delegate and set the delegate to your scrollview instance.
精彩评论