Swiftpack.co - cemolcay/XYPad as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by cemolcay.
cemolcay/XYPad 0.1
A quick and easy xy-pad control for iOS
⭐️ 2
🕓 2 years ago
.package(url: "https://github.com/cemolcay/XYPad.git", from: "0.1")

XYPad

A quick and easy XY-Pad control for iOS, suitable for controlling two values on a 2D-grid such as music applications.

alt

Install

Add the repo url to your swift package manager.

https://github.com/cemolcay/XYPad.git

Usage

  • Create an instance of XYPad
  • Listen its valueChanged event
var xyPad = XYPad()

override func viewDidLoad() {
    super.viewDidLoad()
    view.addSubview(xyPad)
    xyPad.addTarget(self, action: #selector(xyPadValueChanged(sender:)), for: .valueChanged)
}

@IBAction func xyPadValueChanged(sender: XYPad) {
    print(sender.xValue, sender.yValue)
}
  • You can adjust the indicatorSize, indicatorView, xLabel, yLabel, xLine and yLine values after the initialization.

  • You can set minXValue and maxXValue

  • You can set minYValue and maxYValue

  • for the x-y value ranges.

  • Set resetsToCenter property to true if you want to the xy-pad resets its value to the center after the user lifts off their finger.

GitHub

link
Stars: 2
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Initial Release
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics