According to the scroll view offset do something, like change navigation bar alpha. I wrapped a change navigation bar alpha animation, you can make custom animation or do something by yourself. Simply construct a handle by scroll offset.
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 8.0 later
HYHScrollOffsetManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'HYHScrollOffsetManager'
@property (nonatomic, strong) HYHScrollOffsetManager *scrollViewManager;
/// 应用默认的navigation bar 处理动画
_scrollViewManager = [HYHScrollOffsetManager scrollOffsetManager:_tableView];
_scrollViewManager.animateRange = HYHAnimateDistanceRangeMake(100, 90, 0.25);
/// 应用自己处理
_scrollViewManager = [HYHScrollOffsetManager scrollOffsetManager:_tableView];
_scrollViewManager.animateRange = HYHAnimateDistanceRangeMake(100, 90, 0.25);
_scrollViewManager.animationType = HYHScrollOffsetAnimationTypeCustom;
_scrollViewManager.customAnimationBlock = ^(CGPoint offset, HYHAnimateDistanceRange range) {
// handle logic by offset
};
I'm harry, and a iOSer. You can send me QQ email ([1335430614@qq.com]), or has issues in Issues module.
HYHScrollOffsetManager is available under the MIT license. See the LICENSE file for more info.