Inspired by Bilibili:
Demo:
The easiest way to use GuttlerPageControl
is installing it by CocoaPods. Add these lines to your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'GuttlerPageControl', '~> 0.1.1'
Clone this repo and throw the source files under Classes
folder into your project to use it.
import GuttlerPageControl
// Just init with position and numOfpage
let guttlerPageControl = GuttlerPageControl(center: view.center, pages: numOfpage)
// Must bind pageControl with the scrollView
guttlerPageControl.bindScrollView = scrollView
// Just invoke scrollWithScrollView(_:) in scrollViewDidScroll(_:)
func scrollViewDidScroll(scrollView: UIScrollView) {
guttlerPageControl.scrollWithScrollView(scrollView)
}
Thanks for onevcat's RandomColorSwift, It's wonderful.
This project is licensed under the terms of the MIT license.