A quick and easy XY-Pad control for iOS, suitable for controlling two values on a 2D-grid such as music applications.
Add the repo url to your swift package manager.
https://github.com/cemolcay/XYPad.git
XYPad
valueChanged
eventvar 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.
link |
Stars: 2 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics