灵感来自哔哩哔哩
演示
克隆此仓库,并将源文件放在 Classes
文件夹中,然后将它们添加到您的项目中使用。
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)
}
感谢 onevcat 的 RandomColorSwift,它很棒。
该项目使用 MIT 许可证许可。