Skip to content

arijits95/ASPageControlView

Repository files navigation

ASPageControlView

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Xcode 9 and Swift 4

Installation

ASPageControlView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ASPageControlView'

alt-text

A simple and easy to use page control view with a beautiful animation to mark the change in page.

Usage

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.

alt-text

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

Author

arijits95,arijits95@gmail.com,tesla-nikola, sohamray91@gmail.com

License

ASPageControlView is available under the MIT license. See the LICENSE file for more info.

About

A plug and play Page control view which animates the change of the current page. The appearance of the page control view is customisable.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors