RSDActiveStepViewController
open class RSDActiveStepViewController: RSDStepViewController
RSDActiveStepViewController
is a simple timer for displaying a longer activity where the user is doing an action while
the countdown timer is running.
This view controller includes a default nib implementation that is included in this framework. It includes various UI elements that can indicate to the user how much time is remaining in a longer-running step. For example, this could be used during a walk step to indicate to the user how long they have been walking as well as how much longer they have to walk before the step is complete.
-
An instruction label that is updated to show the same text that is spoken as a spoken instruction to the user.
Seealso
`speakInstruction(_:, at:, completion:)Declaration
Swift
@IBOutlet open var instructionLabel: UILabel?
-
The countdown dial is a graphical element used to display progress to the user.
Declaration
Swift
@IBOutlet open var countdownDial: RSDProgressIndicator?
-
The progress label is a label that can be used to indicate progress measured by some unit other than time (which is shown using the
countdownDial
). For example, in a walking step, a subclass may use this label to display the distance the user walked (calulated using GPS or pedometer sensor data) or the number of steps taken.Note
The default implementation does not use this label, but it is included so that subclasses may take advantage of it and still use the default nib included in this framework.
Seealso
Declaration
Swift
@IBOutlet open var progressLabel: UILabel?
-
The unit label is a label that can be used to indicate the unit of the progress label. It is included as a separate label to allow that text to be easily defined with a different font, color, and/or position in the associated nib or storyboard.For example, in a walking step, a subclass may use the progress label to display the distance the user walked (calulated using GPS or pedometer sensor data) and would then assign this label to the
feet
ormeters
showing the unit of measurement.Note
The default implementation does not use this label, but it is included so that subclasses may take advantage of it and still use the default nib included in this framework.
Seealso
Declaration
Swift
@IBOutlet open var unitLabel: UILabel?
-
A label that is updated to show a countdown. For example,
5:35
.Declaration
Swift
@IBOutlet open var countdownLabel: UILabel?
-
Formatter for the countdown label.
Declaration
Swift
lazy open var countdownFormatter : DateComponentsFormatter =
-
This class overrides
didSet
to update thecountdownLabel
to the new value formatted as a time interval in seconds. ThecountdownFormatter
is used to format the string derived from this time interval.Declaration
Swift
open override var countdown: Int
-
This class overrides the speak instruction method and will set the
instructionLabel
to the same text that the voice synthesizer speaks.Declaration
Swift
open override func speakInstruction(_ instruction: String, at timeInterval: TimeInterval, completion: RSDVoiceBoxCompletionHandler?)
-
The start method is overridden to start the countdown dial animation.
Declaration
Swift
open override func start()
-
The pause method is overridden to pause the countdown dial animation.
Declaration
Swift
override open func pause()
-
The pause method is overridden to resume the countdown dial animation.
Declaration
Swift
override open func resume()
-
Override
viewDidLoad
to set up initial values for the labels and progress indicators.Declaration
Swift
open override func viewDidLoad()
-
The default nib name to use when instantiating the view controller using
init(step:)
.Declaration
Swift
open class var nibName: String
-
The default bundle to use when instantiating the view controller using
init(step:)
.Declaration
Swift
open class var bundle: Bundle
-
Initialize the class using the given nib and bundle.
Note
If this initializer is used with anil
nib, then it must assign the expected outlets.Declaration
Parameters
nibNameOrNil
The name of the nib or
nil
.nibBundleOrNil
The name of the bundle or
nil
. -
Required initializer. This is the initializer used by a
UIStoryboard
.Declaration
Swift
public required init?(coder aDecoder: NSCoder)
Parameters
aDecoder
The decoder used to initialize this view controller.