Latest | 1.0.0 |
---|---|
Homepage | https://github.com/gongtao/GTCyclePageView |
License | MIT |
Platforms | ios , requires ARC |
Frameworks | UIKit |
Authors |
GTCyclePageView
GTCyclePageView is a view that can circularly scroll pages. The way that GTCyclePageView uses datasource to load each page view is almost the same way as UITableView
.
It’s based on UIScrollView
, and its delegate inherit from UIScrollViewDelegate
.
How to get started?
- Download GTCyclePageView and add files under the Class folder into your project.
GTCyclePageViewDataSource
Use GTCyclePageViewDataSource to load page contents. GTCyclePageViewCell is a sub class of UIView
. You can add subViews to GTCyclePageViewCell object, or write your own page content view that inherits from GTCyclePageViewCell class.
- (NSUInteger)numberOfPagesInCyclePageView:(GTCyclePageView *)cyclePageView
{
return 5;
}
- (GTCyclePageViewCell *)cyclePageView:(GTCyclePageView *)cyclePageView index:(NSUInteger)index
{
static NSString *cellIdentifier = @"cellIdentifier";
GTCyclePageViewCell *cell = [cyclePageView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
cell = [[GTCyclePageViewCell alloc] initWithReuseIdentifier:cellIdentifier];
}
//Customize cell here...
return cell;
}
GTCyclePageViewDelegate
GTCyclePageViewDelegate inherit from UIScrollViewDelegate
. The below method is called when the page changes.
- (void)didPageChangedCyclePageView:(GTCyclePageView *)cyclePageView
The below method is called when a displayed cell is tapped.
- (void)cyclePageView:(GTCyclePageView *)cyclePageView didTouchCellAtIndex:(NSUInteger)index
Others
Return the GTCyclePageViewCell object from unusable array by cellIdentifier.
- (GTCyclePageViewCell *)dequeueReusableCellWithIdentifier:(NSString *)cellIdentifier;
Scroll to next or pre page.
- (void)scrollToNextPage:(BOOL)animated;
- (void)scrollToPrePage:(BOOL)animated;
The current page of GTCyclePageViewCell object. Set it to change page.
@property (nonatomic, assign) NSUInteger currentPage;
Contact
龚涛 Gong Tao mail: [email protected]
Latest podspec
{ "name": "GTCyclePageView", "version": "1.0.0", "summary": "Display page content circularly in UIScrollView", "homepage": "https://github.com/gongtao/GTCyclePageView", "license": { "type": "MIT", "file": "LICENSE.txt" }, "authors": { "gongtao": "[email protected]" }, "platforms": { "ios": null }, "source": { "git": "https://github.com/gongtao/GTCyclePageView.git", "tag": "1.0.0" }, "source_files": "Class/*.{h,m}", "frameworks": "UIKit", "requires_arc": true }
Sun, 28 Feb 2016 14:10:03 +0000