SDLChoice Class Reference

Section Contents

Overview

A choice is an option which a user can select either via the menu or via voice recognition (VR) during an application initiated interaction.

Parameter List
Name Type Description SmartDeviceLink Ver. Available
choiceID NSNumber * Application-scoped identifier that uniquely identifies this choice.
Min: 0
Max: 65535
SmartDeviceLink 1.0
menuName NSString * Text which appears in menu, representing this choice.
Min: 1
Max: 100
SmartDeviceLink 1.0
vrCommands NSArray * An array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element SmartDeviceLink 1.0
image SDLImage * Either a static hex icon value or a binary image file name identifier (sent by PutFile). SmartDeviceLink 2.0

Since SmartDeviceLink 1.0

-initWithId:menuName:vrCommands:

Undocumented

Objective-C

- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(NSArray<NSString *> *)vrCommands;

Swift

init(id choiceId: UInt16, menuName: String, vrCommands: [String])

-initWithId:menuName:vrCommands:image:secondaryText:secondaryImage:tertiaryText:

Undocumented

Objective-C

- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(NSArray<NSString *> *)vrCommands image:(nullable SDLImage *)image secondaryText:(nullable NSString *)secondaryText secondaryImage:(nullable SDLImage *)secondaryImage tertiaryText:(nullable NSString *)tertiaryText;

Swift

init(id choiceId: UInt16, menuName: String, vrCommands: [String], image: SDLImage?, secondaryText: String?, secondaryImage: SDLImage?, tertiaryText: String?)

choiceID

@abstract the application-scoped identifier that uniquely identifies this choice

Required, Integer 0 - 65535

Objective-C

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

Swift

var choiceID: NSNumber & SDLInt { get set }

menuName

@abstract Text which appears in menu, representing this choice

Required, Max string length 500 chars

Objective-C

@property (readwrite, strong, nonatomic) NSString *_Nonnull menuName;

Swift

var menuName: String { get set }

vrCommands

@abstract VR synonyms for this choice

Required, Array of Strings, Array length 1 - 100, Max String length 99 chars

Objective-C

@property (readwrite, strong, nonatomic)
    NSArray<NSString *> *_Nonnull vrCommands;

Swift

var vrCommands: [String] { get set }

image

@abstract The image of the choice

Optional

Objective-C

@property (readwrite, strong, nonatomic, nullable) SDLImage *image;

Swift

var image: SDLImage? { get set }

secondaryText

@abstract Optional secondary text to display; e.g. address of POI in a search result entry

Optional, Max String length 500 chars

Objective-C

@property (readwrite, strong, nonatomic, nullable) NSString *secondaryText;

Swift

var secondaryText: String? { get set }

tertiaryText

@abstract Optional tertiary text to display; e.g. distance to POI for a search result entry

Optional, Max String length 500 chars

Objective-C

@property (readwrite, strong, nonatomic, nullable) NSString *tertiaryText;

Swift

var tertiaryText: String? { get set }

secondaryImage

@abstract Optional secondary image for choice

Optional

Objective-C

@property (readwrite, strong, nonatomic, nullable) SDLImage *secondaryImage;

Swift

var secondaryImage: SDLImage? { get set }