To run the example project, clone the repo, and run pod install
from the Example directory first.
JCJoystick is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'JCJoystick'
let joystickView = JCJoystickView()
joystickView.delegate = self
public protocol JCJoystickViewDelegate: AnyObject {
func joystickView(joystickView: JCJoystickView, shouldDrag value: JCJoystickValue) -> Bool
func joystickView(joystickView: JCJoystickView, beganDrag value: JCJoystickValue)
func joystickView(joystickView: JCJoystickView, didDrag value: JCJoystickValue)
func joystickView(joystickView: JCJoystickView, didEndDrag value: JCJoystickValue)
}
-
image
let joystickView = JCJoystickView() joystickView.boundaryImage = <yourImage> joystickView.thumbImage = <yourImage>
-
angleValueType
let joystickView = JCJoystickView() joystickView.angleValueType = .degree // or joystickView.angleValueType = .radian
-
thumbLimitStyle
let joystickView = JCJoystickView() joystickView.thumbLimitStyle = .inside //or joystickView.thumbLimitStyle = .center //or joystickView.thumbLimitStyle = .outside //or joystickView.thumbLimitStyle = .unlimited //or joystickView.thumbLimitStyle = .customWithConstant(constant: 20) //or joystickView.thumbLimitStyle = .customWithMultiplier(multiplier: 1.5)
-
thumbSizeMultiplier
let joystickView = JCJoystickView() joystickView.thumbSizeMultiplier = 0.25
JoongChangYang, didwndckd@gmail.com
JCJoystick is available under the MIT license. See the LICENSE file for more info.