RVS_SpinnerDelegate

@available(iOS 13.0, *)
public protocol RVS_SpinnerDelegate : AnyObject

This is the delegate protocol for the Spinner. It is a Swift class protocol, because it provides the delegate with a Swift object, and is weakly referenced by the Spinner.

Its methods are all “optional” (they have default implementations that do nothing), but the control works best if you use them.

  • spinner(_:singleValueSelected:) Default implementation

    This is called if there was only one value, and the user selected the central button. In this case, the control will not open, but we will send a message.

    Default Implementation

    This is an optional method.

    This is called if there was only one value, and the user selected the central button. In this case, the control will not open, but we will send a message.

    Declaration

    Swift

    func spinner(_: RVS_Spinner, singleValueSelected: RVS_SpinnerDataItem?)

    Parameters

    spinner

    The RVS_Spinner instance.

    singleValueSelected

    The value that was just selected. This is optional.

  • spinner(_:hasSelectedTheValue:) Default implementation

    This is called after the user has used the Spinner to select a value.

    Default Implementation

    This is called after the user has used the Spinner to select a value.

    Declaration

    Swift

    func spinner(_: RVS_Spinner, hasSelectedTheValue: RVS_SpinnerDataItem?)

    Parameters

    spinner

    The RVS_Spinner instance.

    hasSelectedTheValue

    The value that was just selected. This is optional.

  • spinner(_:hasOpenedWithTheValue:) Default implementation

    This is called after the user has “opened” the Spinner.

    Default Implementation

    This is called after the user has “opened” the Spinner.

    Declaration

    Swift

    func spinner(_: RVS_Spinner, hasOpenedWithTheValue: RVS_SpinnerDataItem?)

    Parameters

    spinner

    The RVS_Spinner instance.

    hasOpenedWithTheValue

    The value that was selected when the control opened. This is optional.

  • spinner(_:hasClosedWithTheValue:) Default implementation

    This is called after the user has “closed” the Spinner.

    Default Implementation

    This is called after the user has “closed” the Spinner.

    Declaration

    Swift

    func spinner(_: RVS_Spinner, hasClosedWithTheValue: RVS_SpinnerDataItem?)

    Parameters

    spinner

    The RVS_Spinner instance.

    hasClosedWithTheValue

    The value that was selected when the control closed. This is optional.

  • spinner(_:willCloseWithTheValue:) Default implementation

    This is called before the user closes the spinner. It allows the delegate to interrupt the close process.

    Default Implementation

    This is called before the user closes the spinner. It allows the delegate to interrupt the close process.

    Declaration

    Swift

    func spinner(_: RVS_Spinner, willCloseWithTheValue: RVS_SpinnerDataItem?) -> Bool

    Parameters

    spinner

    The RVS_Spinner instance.

    willCloseWithTheValue

    The value that was selected when the control close was attempted. This is optional.

    Return Value

    True, if the spinner is allowed to continue closing. False, to prevent the spinner from closing.