An scrollView handler for UIScrollView & WKWebView and other scrollViews. Providing scrollview`s subViews reusable.
This repo will no longer be updated. The new versions has been moved to HybridPageKit as a submodule. Integrate ' HybridPageKit/ScrollReuseHandler ' subspecs with Cocoapods.
Extended Reading | 中文 | 扩展阅读
ReusableNestingScrollview
is a component to solve the problem of SubView global reuse and recovery in rolling views. Unlike traditional similar solutions, RNS
does not need to inherit a special ScrollView, does not need to inherit a special Model ,only by extending the Delegate, so that the rolling views such as WKWebView, UIWebView, and so on are more widely supported, more general and independent.
Together with WKWebViewExtension, sub repo of HybridPageKit, which is a general sulotion of news App content page.
iOS 8.0 or later
CocoaPods
platform :ios, '8.0'
pod 'ReusableNestingScrollview'
Cloning the repository
#import "RNSHandler.h"
#Usage
@interface TestModel : NSObject <RNSModelProtocol>
RNSProtocolImp(_uniqueId, _componentFrame, [componentView class],[componentController class], _customContext);
_handler = [[RNSHandler alloc]initWithScrollView:scrollView
externalScrollViewDelegate:self
scrollWorkRange:200.f
componentViewStateChangeBlock:^(RNSComponentViewState state,
NSObject<RNSModelProtocol> *componentItem, __kindof UIView *componentView) {
// handle component state change
// will Prepare & will Display & end Display & end prepare
}];
[_handler reloadComponentViewsWithProcessBlock:^(NSMutableDictionary<NSString *,NSObject<RNSModelProtocol> *> *componentItemDic) {
// update model`s origin
}];
All source code is licensed under the MIT License.