Latest 1.0.0
Homepage https://github.com/leonx98/LXPageControl
License MIT
Platforms ios 9.0
Authors

Xcode 9.0+
iOS 9.0+
Swift 4.0+
CocoaPods Compatible
Carthage compatible
Platform
License

LXPageControl is a simple PageControl with lines.

LXPageControl

Requirements

  • Swift 4+
  • iOS 9.0+
  • Xcode 9+

Installation

CocoaPods

You can use CocoaPods to install LXPageControl by adding it to your Podfile:

pod 'LXPageControl'

Usage

Either you can create the ‘LinePageControl’ programmatically or via Interface Builder.

Via Interface Builder:
Create a ‘UIView’ and assign ‘LinePageControl’ class to it. Customize your Pages within the Xcode Attribute Inspector.

Programmatically:
Create a ‘LinePageControl’ Instance.

The buttons height are equal to the height of the view.

let linePageControl = LinePageControl()

self.view.addSubview(linePageControl)

Additional methods & properties

Public Methods:

linePageControl.set(progress: Int, animated: Bool) // to change the current progress

Public Properties:

linePageControl.leftBtn: UIButton // button to decrease progress
linePageControl.rightBtn: UIButton // button to increase progress
linePageControl.pages: Int // count of Pages
linePageControl.elementWidth: CGFloat // width of an element
linePageControl.elementHeight: CGFloat // height of an element
linePageControl.spacing: CGFloat // spacing between elements
linePageControl.inactiveColor: UIColor // color of inactive elements
linePageControl.activeColor: UIColor // color of active element
linePageControl.cornerRadius: CGLoat // corner radius of the elements
linePageControl.fillWidthAutomatically: Bool // determines automatically the width of each element and fill the entire view width depending on the spacing

Delegate:

linePageControl.delegate = self

Delegate protocol:

public protocol LinePageControlDelegate {
func linePageControl(_ linePageControl: LinePageControl, didPressedOn button: UIButton)
func linePageControl(_ linePageControl: LinePageControl, changeProgress to: Int)
}

Donation

If you like my open source libraries, you can sponsor it! ☺️

paypal

Author

Leon Hoppe, [email protected]

License

Distributed under the MIT license. See LICENSE for more information.

Latest podspec

{
    "name": "LXPageControl",
    "version": "1.0.0",
    "summary": "PageControl with Lines",
    "homepage": "https://github.com/leonx98/LXPageControl",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Leon Hoppe": "[email protected]"
    },
    "source": {
        "git": "https://github.com/leonx98/LXPageControl.git",
        "tag": "1.0.0"
    },
    "swift_version": "4.0",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "LXPageControl/Classes/**/*"
}

Pin It on Pinterest

Share This