ZJPageControl is a custom animated page control to replace UIPageControl, inspired by Tamino Martinius.
Just add the ZJPageControl
folder to your project
Use CocoaPods with Podfile:
pod 'ZJPageControl'
Use Carthage with Cartfile
github "betacats/ZJPageControl"
Just drop UIView and set it's class to be ZJPageControl.
// init
ZJPageControl *pageControl = [[ZJPageControl alloc] initWithFrame:pageControlFrame];
pageControl.numberOfPages = 4;
pageControl.padding = 8;
pageControl.radius = 4;
pageControl.lineWidth = 2;
pageControl.pageIndicatorTintColor = [UIColor blueColor];
pageControl.currentPageIndicatorTintColor = [UIColor redColor];
[pageControl addTarget:self action:@selector(pageControlValueChanged:) forControlEvents:UIControlEventValueChanged];
// set current page
pageControl.currentPage = 2;
// set current page with animation
[pageControl setCurrentPage:2 animated:YES];
- iOS 7.0+
- Xcode 8+
ZJPageControl is released under the MIT license. See LICENSE for details.