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
SDLChoice

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.

Since RPC 1.0

-initWithId:menuName:vrCommands:

Constructs a newly allocated SDLChangeRegistration object with the required parameters

Objective-C

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

Swift

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

Parameters

choiceId

the application-scoped identifier that uniquely identifies this choice

menuName

text which appears in menu, representing this choice

vrCommands

vr synonyms for this choice

Return Value

An instance of the SDLChangeRegistration class.

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

Constructs a newly allocated SDLChangeRegistration object with all parameters

Objective-C

- (nonnull instancetype)initWithId:(UInt16)choiceId
                          menuName:(nonnull NSString *)menuName
                        vrCommands:(nullable 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?)

Parameters

choiceId

the application-scoped identifier that uniquely identifies this choice

menuName

text which appears in menu, representing this choice

vrCommands

vr synonyms for this choice

image

the image of the choice

secondaryText

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

secondaryImage

secondary image for choice

tertiaryText

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

Return Value

An instance of the SDLChangeRegistration class.

choiceID

The application-scoped identifier that uniquely identifies this choice

Required, Integer 0 - 65535

Objective-C

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

Swift

var choiceID: NSNumber & SDLInt { get set }

menuName

Text which appears in menu, representing this choice

Required, Max string length 500 chars

Objective-C

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

Swift

var menuName: String { get set }

vrCommands

VR synonyms for this choice

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

@discussion, VR commands are optional beginning with SDL Core v.5.0. They are required for previous versions.

Objective-C

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

Swift

var vrCommands: [String]? { get set }

image

The image of the choice

Optional

Objective-C

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

Swift

var image: SDLImage? { get set }

secondaryText

Secondary text to display; e.g. address of POI in a search result entry

Optional, Max String length 500 chars

Objective-C

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

Swift

var secondaryText: String? { get set }

tertiaryText

Tertiary text to display; e.g. distance to POI for a search result entry

Optional, Max String length 500 chars

Objective-C

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

Swift

var tertiaryText: String? { get set }

secondaryImage

Secondary image for choice

Optional

Objective-C

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

Swift

var secondaryImage: SDLImage? { get set }
View on GitHub.com
Previous Section Next Section