A flexible UIPageControl like Instagram.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7965a0a Sep 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Carthage/Build/iOS Update Carthage Jun 7, 2017
Demo wip Jun 24, 2018
FlexiblePageControl.xcodeproj update Jun 23, 2018
FlexiblePageControl Added public init with default values Jun 25, 2018
.gitignore Create .gitignore May 4, 2017
.swift-version Fixed pod spec lint error Apr 17, 2017
FlexiblePageControl.podspec Update podspec Sep 9, 2018
LICENSE Create LICENSE Apr 17, 2017
README.md Update README Jun 23, 2018
demo.gif Update Images Apr 29, 2017
demo.jpg Update Images Apr 29, 2017

README.md

FlexiblePageControl

A flexible UIPageControl like Instagram.

Carthage compatible Swift 3.0.x Support

OverView

Install

Carthage

For Installing with Carthage, add it to your Cartfile.

github "shima11/FlexiblePageControl"
$ carthage update

CocoaPods

For installing with CocoaPods, add it to your Podfile.

pod "FlexiblePageControl"
$ pod update

Usage

let pageControl = FlexiblePageControl()
pageControl.numberOfPages = 10
view.addSubview(pageControl)

Customize

// color
pageControl.pageIndicatorTintColor = color1
pageControl.currentPageIndicatorTintColor = color2

// size
let config = Config(
    displayCount: 7,
    dotSize: 6,
    dotSpace: 4,
    smallDotSizeRatio: 0.5,
    mediumDotSizeRatio: 0.7
)
pageControl.setConfig(config)

Update page

func scrollViewDidScroll(_ scrollView: UIScrollView) {
    pageControl.setProgress(contentOffsetX: scrollView.contentOffset.x, pageWidth: scrollView.bounds.width)
}

or

pageControl.setCurrentPage(at: page)

Licence

Licence MIT