CharPageControl 2.0

CharPageControl 2.0

TestsTested
LangLanguage SwiftSwift
License Apache 2
ReleasedLast Release Sep 2016
SPMSupports SPM

Maintained by Nattawut Singhchai.



  • By
  • Nattawut Singhchai

CharPageControl

CharPageControl is a GLYPH style for pagination written in swift.

Demo

Features

  • [x] Custom font
  • [x] Color transition
  • [x] IBInspectable support

inspecable

  • [ ] IBDesignable support (Error on swift 3)

inspecable

Requirements

  • Swift 2+
  • Swift 3
  • iOS 8.0+

Installation

You can install this library in 2 ways

Manually

Copy CharPageControl.swift to your project.

Usage

  • Import and declare CharPageControl:
import CharPageControl

class ViewController: UIViewController{
  @IBOutlet
  var pageControl: CharPageControl!
}
  • Drag and drop UILabel from panel to storyboard
  • Change UILabel class to CharPageControl
  • Go to Attribute Inspector and set your pattern and other properties
  • Embed label to your ViewController class
  • And set page with CGFloat when scrollView did scroll
func scrollViewDidScroll(scrollView: UIScrollView) {
  let currentPage = (CGFloat(pageCount) * scrollView.contentOffset.x)/scrollView.contentSize.width
  pageControl.currentPage = currentPage
}

And more on CharPageControlExample.xcodeproj

Credit

This project was Inspired by Virakri Jinangkul

Author

Nattawut Singhchai, [email protected]

License

CharPageControl is available under the Apache 2.0 license. See the LICENSE file.