Skip to content

100grams/FlexiblePageControl

 
 

Repository files navigation

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", :git => "https://github.com/shima11/FlexiblePageControl.git"
$ pod update

Usage

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

// Updated to the minimum size according to the displayCount
pageControl.updateViewSize()

Customize

pageControl.dotSize = 8
pageControl.dotSpace = 5

pageControl.displayCount = 8

pageControl.pageIndicatorTintColor = UIColor.gray
pageControl.currentPageIndicatorTintColor = UIColor.blue

Update page

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

or

pageControl.currentPage = page

Licence

Licence MIT

About

A flexible UIPageControl like Instagram.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 62.2%
  • Ruby 34.7%
  • Objective-C 3.1%