Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

SDLChoiceSet Class Reference

Section Contents

Overview

Undocumented

defaultTimeout

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.

Objective-C

@property (assign, readwrite, nonatomic, class) NSTimeInterval defaultTimeout;

Swift

class var defaultTimeout: TimeInterval { get set }

defaultLayout

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.

Objective-C

@property (assign, readwrite, nonatomic, class) SDLChoiceSetLayout defaultLayout;

Swift

class var defaultLayout: SDLChoiceSetLayout { get set }

title

Maps to PerformInteraction.initialText. The title of the choice set, and/or the initial text on a keyboard prompt.

Objective-C

@property (readwrite, copy, nonatomic) NSString *_Nonnull title;

Swift

var title: String { get set }

initialPrompt

Maps to PerformInteraction.initialPrompt. The initial prompt spoken to the user at the start of an interaction.

Objective-C

@property (readwrite, copy, nonatomic, nullable)
    NSArray<SDLTTSChunk *> *initialPrompt;

Swift

var initialPrompt: [SDLTTSChunk]? { get set }

layout

Maps to PerformInteraction.interactionLayout. Whether the presented choices are arranged as a set of tiles or a list.

Objective-C

@property (assign, readwrite, nonatomic) SDLChoiceSetLayout layout;

Swift

var layout: SDLChoiceSetLayout { get set }

timeout

Maps to PerformInteraction.timeout. This applies only to a manual selection (not a voice selection, which has its timeout handled by the system). Defaults to defaultTimeout.

Objective-C

@property (assign, readwrite, nonatomic) NSTimeInterval timeout;

Swift

var timeout: TimeInterval { get set }

timeoutPrompt

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.

Objective-C

@property (readwrite, copy, nonatomic, nullable)
    NSArray<SDLTTSChunk *> *timeoutPrompt;

Swift

var timeoutPrompt: [SDLTTSChunk]? { get set }

helpPrompt

Maps to PerformInteraction.helpPrompt. This is the spoken string when a user speaks help when the interaction is occurring.

Objective-C

@property (readwrite, copy, nonatomic, nullable)
    NSArray<SDLTTSChunk *> *helpPrompt;

Swift

var helpPrompt: [SDLTTSChunk]? { get set }

helpList

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.

Objective-C

@property (readwrite, copy, nonatomic, nullable)
    NSArray<SDLVRHelpItem *> *helpList;

Swift

var helpList: [SDLVRHelpItem]? { get set }

delegate

The delegate of this choice set, called when the user interacts with it.

Objective-C

@property (readwrite, nonatomic) id<SDLChoiceSetDelegate> _Nullable delegate;

choices

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).

Objective-C

@property (readwrite, copy, nonatomic)
    NSArray<SDLChoiceCell *> *_Nonnull choices;

Swift

var choices: [SDLChoiceCell] { get set }

-initWithTitle:delegate:choices:

Initialize with a title, delegate, and choices. It will use the default timeout and layout, all other properties (such as prompts) will be nil.

Objective-C

- (nonnull instancetype)initWithTitle:(nonnull NSString *)title
                             delegate:(nonnull id<SDLChoiceSetDelegate>)delegate
                              choices:
                                  (nonnull NSArray<SDLChoiceCell *> *)choices;

Parameters

title

The choice set’s title

delegate

The choice set delegate called after the user has interacted with your choice set

choices

The choices to be displayed to the user for interaction

Return Value

The choice set

-initWithTitle:delegate:layout:timeout:initialPromptString:timeoutPromptString:helpPromptString:vrHelpList:choices:

Initializer with all possible properties.

Objective-C

- (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;

Parameters

title

The choice set’s title

delegate

The choice set delegate called after the user has interacted with your choice set

layout

The layout of choice options (Manual/touch only)

timeout

The timeout of a touch interaction (Manual/touch only)

initialPrompt

A voice prompt spoken to the user when this set is displayed

timeoutPrompt

A voice prompt spoken to the user when the set times out (Voice only)

helpPrompt

A voice prompt spoken to the user when the user asks for help

helpList

A table list of text and images shown to the user during a voice recognition session for this choice set (Voice only)

choices

The list of choices presented to the user either as a manual/touch interaction or via the user’s voice

Return Value

The choice set

-initWithTitle:delegate:layout:timeout:initialPrompt:timeoutPrompt:helpPrompt:vrHelpList:choices:

Initializer with all possible properties.

Objective-C

- (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;

Parameters

title

The choice set’s title

delegate

The choice set delegate called after the user has interacted with your choice set

layout

The layout of choice options (Manual/touch only)

timeout

The timeout of a touch interaction (Manual/touch only)

initialPrompt

A voice prompt spoken to the user when this set is displayed

timeoutPrompt

A voice prompt spoken to the user when the set times out (Voice only)

helpPrompt

A voice prompt spoken to the user when the user asks for help

helpList

A table list of text and images shown to the user during a voice recognition session for this choice set (Voice only)

choices

The list of choices presented to the user either as a manual/touch interaction or via the user’s voice

Return Value

The choice set

View on GitHub.com
Previous Section Next Section