SHKnobRing

@IBDesignable
public class SHKnobRing : NSControl

A knob-like multislider, contains 1 value ring, 1 value pointer and a pair of bound-selector

  • Undocumented

    Declaration

    Swift

    public override init(frame frameRect: NSRect)
  • Undocumented

    Declaration

    Swift

    public required init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    public override func prepareForInterfaceBuilder()
  • Only send value update to delegate when input value is within lowerbound and upperbound

    Declaration

    Swift

    @IBInspectable
    public var isGated: Bool { get set }
  • Unused

    Declaration

    Swift

    @IBInspectable
    public var isReversed: Bool
  • Value pointer will jump within upper/lower bounds when it’s true, else it will jump between min/map. Default is true

    Declaration

    Swift

    @IBInspectable
    public var hardclipValuePointer: Bool
  • Undocumented

    Declaration

    Swift

    @IBInspectable
    public override var isEnabled: Bool { get set }
  • Delegate

    Declaration

    Swift

    public var delegate: SHKnobRingDelegate?
  • min

    Min of input value

    Declaration

    Swift

    @IBInspectable
    public var min: Float { get set }
  • max

    Max of input value

    Declaration

    Swift

    @IBInspectable
    public var max: Float { get set }
  • Color of the ring outline

    Declaration

    Swift

    @IBInspectable
    public var ringColor: NSColor { get set }
  • Color of the value ring

    Declaration

    Swift

    @IBInspectable
    public var tintColor: NSColor { get set }
  • Color of the value pointer

    Declaration

    Swift

    public var valuePointerColor: NSColor { get set }
  • Color of the max/min pointer

    Declaration

    Swift

    public var boundPointerColor: NSColor { get set }
  • Line width for the ring outline, note that value ring’s line width will always be ringWidth + 2

    Declaration

    Swift

    public var ringWidth: CGFloat { get set }
  • Line Width for the value pointer

    Declaration

    Swift

    public var pointerWidth: CGFloat { get set }
  • Line width for the lower and upper bounds pointers

    Declaration

    Swift

    public var boundPointerWidth: CGFloat { get set }
  • Start angle of the ring, default is 247.5˚(11/8*pi), note that this has to be in degree instead of radians

    Declaration

    Swift

    public var startAngle: CGFloat { get set }
  • Engle angle of the ring, default is -67.5˚ (-3/8*pi), note that this has to be in degree instead of radians

    Declaration

    Swift

    public var endAngle: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    public func getBounds() -> (lower: Int, upper: Int)
  • Set value for value pointer

    Declaration

    Swift

    public func setValue(_ newValue: Float, animated: Bool = false)

    Parameters

    newValue

    input value to be displayed

    animated

    unused

  • Set lower bound’s value

    Declaration

    Swift

    public func setLowerBoundValue(_ newValue: Float)

    Parameters

    newValue

    new lower bound value, output value will be remapped from min-max to lowerBound-upperBound

  • Set upper bound’s value

    Declaration

    Swift

    public func setUppderBoundValue(_ newValue: Float)

    Parameters

    newValue

    new upper bound value, output value will be remapped from min-max to lowerBound-upperBound

  • Reset: displayValue= min, lowerBound = min, upperBound = max

    Declaration

    Swift

    public func reset()
  • Undocumented

    Declaration

    Swift

    public override func mouseDown(with event: NSEvent)
  • Undocumented

    Declaration

    Swift

    public override func mouseUp(with event: NSEvent)
  • Undocumented

    Declaration

    Swift

    public override func mouseDragged(with event: NSEvent)