Skip to content

cemolcay/XYPad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A quick and easy xy-pad control for iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages