The choice set to be displayed to the user. Contains a list of selectable options.
Set this to change the default timeout for all choice sets. If a timeout is not set on an individual choice set object (or if it is set to 0.0), then it will use this timeout instead. See timeout
for more details. If this is not set by you, it will default to 10 seconds. The minimum is 5 seconds, the maximum is 100 seconds. If this is set below the minimum, it will be capped at 5 seconds. If this is set above the maximum, it will be capped at 100 seconds.
@property (class, nonatomic) NSTimeInterval defaultTimeout;
class var defaultTimeout: TimeInterval { get set }
Set this to change the default layout for all choice sets. If a layout is not set on an individual choice set object, then it will use this layout instead. See layout
for more details. If this is not set by you, it will default to SDLChoiceSetLayoutList
.
@property (class, nonatomic) SDLChoiceSetLayout defaultLayout;
class var defaultLayout: SDLChoiceSetLayout { get set }
Maps to PerformInteraction.initialText. The title of the choice set, and/or the initial text on a keyboard prompt.
@property (nonatomic, copy) NSString *_Nonnull title;
var title: String { get set }
Maps to PerformInteraction.initialPrompt. The initial prompt spoken to the user at the start of an interaction.
@property (nonatomic, copy, nullable) NSArray<SDLTTSChunk *> *initialPrompt;
var initialPrompt: [SDLTTSChunk]? { get set }
Maps to PerformInteraction.interactionLayout. Whether the presented choices are arranged as a set of tiles or a list.
@property (nonatomic) SDLChoiceSetLayout layout;
var layout: SDLChoiceSetLayout { get set }
Maps to PerformInteraction.timeout. Timeout in seconds. Defaults to 0, which will use defaultTimeout
. If this is set below the minimum, it will be capped at 5 seconds. Minimum 5 seconds, maximum 100 seconds. If this is set above the maximum, it will be capped at 100 seconds. Defaults to 0.
Note
This applies only to a manual selection (not a voice selection, which has its timeout handled by the system).@property (nonatomic) NSTimeInterval timeout;
var timeout: TimeInterval { get set }
Maps to PerformInteraction.timeoutPrompt. This text is spoken when a VR interaction times out. If this set is presented in a manual (non-voice) only interaction, this will be ignored.
@property (nonatomic, copy, nullable) NSArray<SDLTTSChunk *> *timeoutPrompt;
var timeoutPrompt: [SDLTTSChunk]? { get set }
Maps to PerformInteraction.helpPrompt. This is the spoken string when a user speaks “help” when the interaction is occurring.
@property (nonatomic, copy, nullable) NSArray<SDLTTSChunk *> *helpPrompt;
var helpPrompt: [SDLTTSChunk]? { get set }
Maps to PerformInteraction.vrHelp. This is a list of help text presented to the user when they are in a voice recognition interaction from your choice set of options. If this set is presented in a touch only interaction, this will be ignored.
Note
that while SDLVRHelpItem’s position will be automatically set based on position in the array, the image will need to uploaded by you before use using SDLFileManager.@property (nonatomic, copy, nullable) NSArray<SDLVRHelpItem *> *helpList;
var helpList: [SDLVRHelpItem]? { get set }
The delegate of this choice set, called when the user interacts with it.
@property (nonatomic, weak) id<SDLChoiceSetDelegate> _Nullable delegate;
The choices to be displayed to the user within this choice set. These choices could match those already preloaded via SDLScreenManager preloadChoices:withCompletionHandler:
.
This is limited to 100 items. If you attempt to set more than 100 items, the set will not have any items (this array will be empty).
@property (nonatomic, copy) NSArray<SDLChoiceCell *> *_Nonnull choices;
var choices: [SDLChoiceCell] { get set }
Initialize with a title, delegate, and choices. It will use the default timeout and layout, all other properties (such as prompts) will be nil
.
WARNING: If you display multiple cells with the same text
with the only uniquing property between cells being different vrCommands
or a feature that is not displayed on the head unit (e.g. if the head unit doesn’t display secondaryArtwork
and that’s the only uniquing property between two cells) then the cells may appear to be the same to the user in Manual
mode. This only applies to RPC connections >= 7.1.0.
WARNING: On < 7.1.0 connections, the text
cell will be automatically modified among cells that have the same text
when they are preloaded, so they will always appear differently on-screen when they are displayed. cell.uniqueText
will be created by appending (2)
, (3)
, etc.
- (nonnull instancetype)init;
init()
Initialize with a title, delegate, and choices. It will use the default timeout and layout, all other properties (such as prompts) will be nil
.
WARNING: If you display multiple cells with the same text
with the only uniquing property between cells being different vrCommands
or a feature that is not displayed on the head unit (e.g. if the head unit doesn’t display secondaryArtwork
and that’s the only uniquing property between two cells) then the cells may appear to be the same to the user in Manual
mode. This only applies to RPC connections >= 7.1.0.
WARNING: On < 7.1.0 connections, the text
cell will be automatically modified among cells that have the same text
when they are preloaded, so they will always appear differently on-screen when they are displayed. cell.uniqueText
will be created by appending (2)
, (3)
, etc.
- (nonnull instancetype)initWithTitle:(nonnull NSString *)title
delegate:(nonnull id<SDLChoiceSetDelegate>)delegate
choices:
(nonnull NSArray<SDLChoiceCell *> *)choices;
The choice set’s title
The choice set delegate called after the user has interacted with your choice set
The choices to be displayed to the user for interaction
The choice set
Initializer with all possible properties.
WARNING: If you display multiple cells with the same text
with the only uniquing property between cells being different vrCommands
or a feature that is not displayed on the head unit (e.g. if the head unit doesn’t display secondaryArtwork
and that’s the only uniquing property between two cells) then the cells may appear to be the same to the user in Manual
mode. This only applies to RPC connections >= 7.1.0.
WARNING: On < 7.1.0 connections, the text
cell will be automatically modified among cells that have the same text
when they are preloaded, so they will always appear differently on-screen when they are displayed. cell.uniqueText
will be created by appending (2)
, (3)
, etc.
- (nonnull instancetype)
initWithTitle:(nonnull NSString *)title
delegate:(nonnull id<SDLChoiceSetDelegate>)delegate
layout:(SDLChoiceSetLayout)layout
timeout:(NSTimeInterval)timeout
initialPromptString:(nullable NSString *)initialPrompt
timeoutPromptString:(nullable NSString *)timeoutPrompt
helpPromptString:(nullable NSString *)helpPrompt
vrHelpList:(nullable NSArray<SDLVRHelpItem *> *)helpList
choices:(nonnull NSArray<SDLChoiceCell *> *)choices;
The choice set’s title
The choice set delegate called after the user has interacted with your choice set
The layout of choice options (Manual/touch only)
The timeout of a touch interaction in seconds (Manual/touch only)
A voice prompt spoken to the user when this set is displayed
A voice prompt spoken to the user when the set times out (Voice only)
A voice prompt spoken to the user when the user asks for “help”
A table list of text and images shown to the user during a voice recognition session for this choice set (Voice only)
The list of choices presented to the user either as a manual/touch interaction or via the user’s voice
The choice set
Initializer with all possible properties.
WARNING: If you display multiple cells with the same text
with the only uniquing property between cells being different vrCommands
or a feature that is not displayed on the head unit (e.g. if the head unit doesn’t display secondaryArtwork
and that’s the only uniquing property between two cells) then the cells may appear to be the same to the user in Manual
mode. This only applies to RPC connections >= 7.1.0.
WARNING: On < 7.1.0 connections, the text
cell will be automatically modified among cells that have the same text
when they are preloaded, so they will always appear differently on-screen when they are displayed. cell.uniqueText
will be created by appending (2)
, (3)
, etc.
- (nonnull instancetype)
initWithTitle:(nonnull NSString *)title
delegate:(nonnull id<SDLChoiceSetDelegate>)delegate
layout:(SDLChoiceSetLayout)layout
timeout:(NSTimeInterval)timeout
initialPrompt:(nullable NSArray<SDLTTSChunk *> *)initialPrompt
timeoutPrompt:(nullable NSArray<SDLTTSChunk *> *)timeoutPrompt
helpPrompt:(nullable NSArray<SDLTTSChunk *> *)helpPrompt
vrHelpList:(nullable NSArray<SDLVRHelpItem *> *)helpList
choices:(nonnull NSArray<SDLChoiceCell *> *)choices;
The choice set’s title
The choice set delegate called after the user has interacted with your choice set
The layout of choice options (Manual/touch only)
The timeout of a touch interaction in seconds (Manual/touch only)
A voice prompt spoken to the user when this set is displayed
A voice prompt spoken to the user when the set times out (Voice only)
A voice prompt spoken to the user when the user asks for “help”
A table list of text and images shown to the user during a voice recognition session for this choice set (Voice only)
The list of choices presented to the user either as a manual/touch interaction or via the user’s voice
The choice set
Cancels the choice set. If the choice set has not yet been sent to Core, it will not be sent. If the choice set is already presented on Core, the choice set will be immediately dismissed. Canceling an already presented choice set will only work if connected to Core versions 6.0+. On older versions of Core, the choice set will not be dismissed.
- (void)cancel;
func cancel()