RSDActiveUIStepCommand
public struct RSDActiveUIStepCommand : RSDStringLiteralOptionSet
RSDActiveUIStepCommand is an OptionSet for certain commonly used commands that are used at the
beginning and end of an active step.
Seealso
RSDActiveUIStep
-
The corresponding value of the raw type.
A new instance initialized with
rawValuewill be equivalent to this instance.Declaration
Swift
public let rawValue: Int -
Required initializer for a
RawRepresentable.Declaration
Swift
public init(rawValue: Int)Parameters
rawValueThe raw value for this command.
-
Initializer for a command (or set of commands) that are represented by a string value.
Declaration
Swift
public init(_ unionSet: RSDActiveUIStepCommand, codingKey: String)Parameters
unionSetThe set of commands included in this set.
codingKeyThe string representation.
-
Creates a new instance by decoding from the given decoder.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
Declaration
Swift
public init(from decoder: Decoder) throwsParameters
decoderThe decoder to read data from.
-
A mapping of an option to a string value. This is used to allow
Codableprotocol conformance using human-readable strings rather thanBinaryflags.Seealso
The following is a list of the Codable keys defined in this framework.
playSoundOnStartplaySoundOnFinishplaySoundvibrateOnStartvibrateOnFinishvibratestartTimerAutomaticallycontinueOnFinishtransitionAutomaticallyshouldDisableIdleTimerDeclaration
Swift
public private(set) static var stringMapping: [String : Int] = [:] -
A convenience method for mapping a
rawValueto aString.Declaration
Swift
public static func set(rawValue: RawValue, forKey: String)Parameters
rawValueThe raw value for this command.
forKeyThe string representation.
-
Play a default sound when the step starts.
Declaration
Swift
public static let playSoundOnStart = RSDActiveUIStepCommand(1 << 0, codingKey: "playSoundOnStart") -
Play a default sound when the step finishes.
Declaration
Swift
public static let playSoundOnFinish = RSDActiveUIStepCommand(1 << 1, codingKey: "playSoundOnFinish") -
Play a default sound when the step starts and finishes.
Declaration
Swift
public static let playSound = RSDActiveUIStepCommand([.playSoundOnStart, .playSoundOnFinish], codingKey: "playSound") -
Vibrate when the step starts.
Declaration
Swift
public static let vibrateOnStart = RSDActiveUIStepCommand(1 << 2, codingKey: "vibrateOnStart") -
Vibrate when the step finishes.
Declaration
Swift
public static let vibrateOnFinish = RSDActiveUIStepCommand(1 << 3, codingKey: "vibrateOnFinish") -
Vibrate when the step starts and finishes.
Declaration
Swift
public static let vibrate = RSDActiveUIStepCommand([.vibrateOnStart, .vibrateOnFinish], codingKey: "vibrate") -
Start the count down timer automatically when the step start.
Declaration
Swift
public static let startTimerAutomatically = RSDActiveUIStepCommand(1 << 4, codingKey: "startTimerAutomatically") -
Transition automatically when the step finishes.
Declaration
Swift
public static let continueOnFinish = RSDActiveUIStepCommand(1 << 5, codingKey: "continueOnFinish") -
Start the count down timer automatically when the step starts and transition automatically when the step finishes.
Declaration
Swift
public static let transitionAutomatically = RSDActiveUIStepCommand([.startTimerAutomatically, .continueOnFinish], codingKey: "transitionAutomatically") -
Disable the idle timer if included.
Declaration
Swift
public static let shouldDisableIdleTimer = RSDActiveUIStepCommand(1 << 6, codingKey: "shouldDisableIdleTimer") -
The default commands for a step.
Declaration
Swift
public static let defaultCommands: RSDActiveUIStepCommand = []
View on GitHub
RSDActiveUIStepCommand Structure Reference