Saturday, 14 September 2013

UIScrollView subclass trigger event

UIScrollView subclass trigger event

I've tried for some days understand Xcode Subclasses and Categories - and
after all I found one event that are fired.
- (void)setContentOffset:(CGPoint)contentOffset {
NSLog(@"foo");
}
And for more confusion, after read Apple iOS Documentation I get this stuff:
- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated {
NSLog(@"bar");
}
First event are fired, but from Apple documentation are not. Why?!
But in the first case, although he was fired the UIScrollView loses their
scroll/drag'n' bounce behavior. I think it's because after overrride
setContentOffset I would need to call the parent method to keep the
default behavior of the UIScrollView. But I'm already exhausted from test
obsolete Xcode approaches.
Than why second code are not fired and how call parent overridden method?
Thanks in advance.

No comments:

Post a Comment