I have a custom UIView
that is added to as a subView
of a UIScrollView
, and I want that UIView
automatically repositioned whenever the UIScrollView
scrolls. In addition to observe the UIScrollView's
contentOffset
property(which works fine), I also need observes its dragging
property:
[scrollView addObserver:self
forKeyPath:@"dragging"
options:NSKeyValueObservingOptionNew
context:NULL];
but in the observeValueForKeyPath:ofObject:change:context
method, I didn't receive any NSNotification
for the change of the dragging
property, what's the problem here? Thanks.
updated
Since i'm gonna reuse this custom UIView
in multiple UIViewControllers
, I want the custom view itself handles the repositioning logic, rather than duplicate the repositioning logic in each UIViewController's
UIScrollViewDelegate
methods(like scrollViewDidScroll
thing).
dragging
property anymore. – Gehenna