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(_:Default implementationsingleValueSelected: ) 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
spinnerThe RVS_Spinner instance.
singleValueSelectedThe value that was just selected. This is optional.
-
spinner(_:Default implementationhasSelectedTheValue: ) 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
spinnerThe RVS_Spinner instance.
hasSelectedTheValueThe value that was just selected. This is optional.
-
spinner(_:Default implementationhasOpenedWithTheValue: ) 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
spinnerThe RVS_Spinner instance.
hasOpenedWithTheValueThe value that was selected when the control opened. This is optional.
-
spinner(_:Default implementationhasClosedWithTheValue: ) 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
spinnerThe RVS_Spinner instance.
hasClosedWithTheValueThe value that was selected when the control closed. This is optional.
-
spinner(_:Default implementationwillCloseWithTheValue: ) 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?) -> BoolParameters
spinnerThe RVS_Spinner instance.
willCloseWithTheValueThe 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.
View on GitHub