To run the example project, clone the repo, and run pod install
from the Example directory first.
Xcode 9 and Swift 4
ASPageControlView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ASPageControlView'
A simple and easy to use page control view with a beautiful animation to mark the change in page.
Drag a view onto the storyboard and set it class to ASPageControlView. Provide a width and height constraint for the page control view.
An example demonstrating how to calculate the width and height of the page control :
Padding between cirlces = 10
Diameter of circle = 20
Number of pages = 5
Then set,
Height of page control = Diameter of circle
Width of page control = (Number of pages) * (Diameter of circle) + (Number of pages - 1) * (Padding between cirlces)
Customize the appearance of the page control view by modifying its attributes listed in Attributes Inspector.
You can also create and customize the appearance of the page control programatically.
let pageIndicatorView = ASPageControlView(frame: CGRect(x: 0, y: 0, width: 140, height: 20))
pageIndicatorView.activeColor = UIColor.black
pageIndicatorView.inactiveColor = UIColor.black.withAlphaComponent(0.2)
pageIndicatorView.borderColor = UIColor.black
pageIndicatorView.borderWidth = 1.0
pageIndicatorView.padding = 10.0
pageIndicatorView.totalPages = 5
pageIndicatorView.animationDuration = 0.3
arijits95,arijits95@gmail.com,tesla-nikola, sohamray91@gmail.com
ASPageControlView is available under the MIT license. See the LICENSE file for more info.