
CharPageControl is a GLYPH style for pagination written in swift.
- Custom font
- Color transition
- IBInspectable support
- IBDesignable support (Error on swift 3)
- Swift 2+
- Swift 3
- iOS 8.0+
You can install this library in 2 ways
Copy CharPageControl.swift to your project.
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate CharPageControl into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'CharPageControl', '~> 2.0'
Then, run the following command:
$ pod install
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate CharPageControl into your Xcode project using Carthage, specify it in your Cartfile
:
github "indevizible/CharPageControl" ~> 2.0
Run carthage update
to build the framework and drag the built CharPageControl.framework
into your Xcode project.
- 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
This project was Inspired by Virakri Jinangkul
Nattawut Singhchai, [email protected]
CharPageControl is available under the Apache 2.0 license. See the LICENSE file.