An infinite scroll control implemented with two views, supporting custom reuse of views.
- iOS 8.0+
Programming in Swift? Try LCCycleBanner for a more conventional set of APIs.
- Supports infinite scrolling.
- Reuse with two views.
- Support for custom reuse views.
LCInfiniteScrollView *v = [[LCInfiniteScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 300)];
v.backgroundColor = UIColor.brownColor;
v.delegate = self;
v.autoScroll = YES;
[self.view addSubview:v];
- (UIView *)reusableViewInInfiniteScrollView:(LCInfiniteScrollView *)infiniteScrollView {
UILabel *label = [UILabel new];
label.font = [UIFont boldSystemFontOfSize:30];
label.textAlignment = NSTextAlignmentCenter;
return label;
}
- (void)infiniteScrollView:(LCInfiniteScrollView *)infiniteScrollView reusableView:(UIView *)reusableView atIndex:(NSInteger)index {
UILabel *label = (UILabel *)reusableView;
label.text = @(index).stringValue;
label.backgroundColor = (UIColor *)self.colors[index];
}
To integrate LCInfiniteScrollView into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'LCInfiniteScrollView'
-
Download all the files in the LCInfiniteScrollView subdirectory.
-
Add the source files to your Xcode project.
-
import
LCInfiniteScrollView.h
.
LCInfiniteScrollView is provided under the MIT license. See LICENSE file for details.