ISPageControl has a page control similar to that used in the Instagram
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
CocoaPods 1.1+ is required to build ISPageControl 4.0+.
To integrate ISPageControl into your Xcode project using CocoaPods, specify it in your
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! target '<Your Target Name>' do pod 'ISPageControl', '~> 0.1.0' end
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 ISPageControl into your Xcode project using Carthage, specify it in your
github "Interactive-Studio/ISPageControl" ~> 0.1.0
carthage update to build the framework and drag the built
ISPageControl.framework into your Xcode project.
If you prefer not to use either of the aforementioned dependency managers, you can integrate ISPageControl into your project manually.
The usage of ISPageControl is very simple
Just drop UIView and set its class to be one of ISPageControl.
let frame = CGRect(x: 0, y: 500, width: UIScreen.main.bounds.width, height: 100) pageControl = ISPageControl(frame: frame, numberOfPages: 4) pageControl.radius = 10 pageControl.padding = 10 pageControl.inactiveTintColor = UIColor.purple pageControl.borderWidth = 3 pageControl.borderColor = UIColor.red view.addSubview(pageControl)
open var inactiveTintColor: UIColor open var currentPageTintColor: UIColor open var radius: CGFloat open var padding: CGFloat open var minScaleValue: CGFloat open var middleScaleValue: CGFloat open var numberOfPages: Int open var hideForSinglePage: Bool open var inactiveTransparency: CGFloat open var borderWidth: CGFloat open var borderColor: UIColor
If you want to know more detailed usage, please refer to Example.
ISPageControl is released under the MIT license. See LICENSE for details.