Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
iOS Documentation
SDLSlider

SDLSlider Class Reference

Section Contents

Overview

Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.

If connecting to SDL Core v.6.0+, the slider can be canceled programmatically using the cancelID. On older versions of SDL Core, the slider will persist until the user has interacted with the slider or the specified timeout has elapsed.

Since SDL 2.0

-initWithNumTicks:position:sliderHeader:sliderFooters:timeout:cancelID:

Convenience init with all parameters.

Objective-C

- (nonnull instancetype)initWithNumTicks:(UInt8)numTicks
                                position:(UInt8)position
                            sliderHeader:(nonnull NSString *)sliderHeader
                           sliderFooters:
                               (nullable NSArray<NSString *> *)sliderFooters
                                 timeout:(UInt16)timeout
                                cancelID:(UInt32)cancelID;

Swift

init(numTicks: UInt8, position: UInt8, sliderHeader: String, sliderFooters: [String]?, timeout: UInt16, cancelID: UInt32)

Parameters

numTicks

Number of selectable items on a horizontal axis

position

Initial position of slider control

sliderHeader

Text header to display

sliderFooters

Text footers to display. See the sliderFooter documentation for how placing various numbers of footers will affect the display

timeout

Indicates how long of a timeout from the last action (i.e. sliding control resets timeout)

cancelID

An ID for this specific slider to allow cancellation through the CancelInteraction RPC.

Return Value

An SDLSlider object

-initWithNumTicks:position:

Creates a slider with only the number of ticks and position. Note that this is not enough to get a SUCCESS response. You must supply additional data. See below for required parameters.

Objective-C

- (nonnull instancetype)initWithNumTicks:(UInt8)numTicks
                                position:(UInt8)position;

Swift

init(numTicks: UInt8, position: UInt8)

Parameters

numTicks

Number of selectable items on a horizontal axis

position

Initial position of slider control

Return Value

An SDLSlider object

-initWithNumTicks:position:sliderHeader:sliderFooter:timeout:

Creates a slider with all required data and a static footer (or no footer).

Objective-C

- (nonnull instancetype)initWithNumTicks:(UInt8)numTicks
                                position:(UInt8)position
                            sliderHeader:(nonnull NSString *)sliderHeader
                            sliderFooter:(nullable NSString *)sliderFooter
                                 timeout:(UInt16)timeout;

Swift

init(numTicks: UInt8, position: UInt8, sliderHeader: String, sliderFooter: String?, timeout: UInt16)

Parameters

numTicks

Number of selectable items on a horizontal axis

position

Initial position of slider control

sliderHeader

Text header to display

sliderFooter

Text footer to display

timeout

Indicates how long of a timeout from the last action (i.e. sliding control resets timeout)

Return Value

An SDLSlider object

-initWithNumTicks:position:sliderHeader:sliderFooters:timeout:

Creates an slider with all required data and a dynamic footer (or no footer).

Objective-C

- (nonnull instancetype)initWithNumTicks:(UInt8)numTicks
                                position:(UInt8)position
                            sliderHeader:(nonnull NSString *)sliderHeader
                           sliderFooters:
                               (nullable NSArray<NSString *> *)sliderFooters
                                 timeout:(UInt16)timeout;

Swift

init(numTicks: UInt8, position: UInt8, sliderHeader: String, sliderFooters: [String]?, timeout: UInt16)

Parameters

numTicks

Number of selectable items on a horizontal axis

position

Initial position of slider control

sliderHeader

Text header to display

sliderFooters

Text footers to display

timeout

Indicates how long of a timeout from the last action (i.e. sliding control resets timeout)

Return Value

An SDLSlider object

numTicks

Represents a number of selectable items on a horizontal axis.

Integer, Required, Min value: 2, Max Value: 26

Since SDL 2.0

Objective-C

@property (nonatomic, strong) NSNumber<SDLInt> *_Nonnull numTicks;

Swift

var numTicks: NSNumber & SDLInt { get set }

position

Initial position of slider control (cannot exceed numTicks).

Integer, Required, Min Value: 1, Max Value: 26

@since SDL 2.0

Objective-C

@property (nonatomic, strong) NSNumber<SDLInt> *_Nonnull position;

Swift

var position: NSNumber & SDLInt { get set }

sliderHeader

Text header to display.

String, Required, Max length 500 chars

Since SDL 2.0

Objective-C

@property (nonatomic, strong) NSString *_Nonnull sliderHeader;

Swift

var sliderHeader: String { get set }

sliderFooter

Text footer to display.

For a static text footer, only one footer string shall be provided in the array. For a dynamic text footer, the number of footer text string in the array must match the numTicks value. For a dynamic text footer, text array string should correlate with potential slider position index. If omitted on supported displays, no footer text shall be displayed.

Array of Strings, Optional, Array length 1 - 26, Max length 500 chars

Since SDL 2.0

Objective-C

@property (nonatomic, strong, nullable) NSArray<NSString *> *sliderFooter;

Swift

var sliderFooter: [String]? { get set }

timeout

App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout). If omitted, the value is set to 10 seconds.

Integer, Optional, Min value: 1000, Max value: 65535, Default value: 10000

Since SDL 2.0

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *timeout;

Swift

var timeout: (NSNumber & SDLInt)? { get set }

cancelID

An ID for this specific slider to allow cancellation through the CancelInteraction RPC.

Integer, Optional

See

SDLCancelInteraction @since SDL 6.0

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *cancelID;

Swift

var cancelID: (NSNumber & SDLInt)? { get set }
View on GitHub.com
Previous Section Next Section