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
SDLChoiceCell

SDLChoiceCell Class Reference

Section Contents

Overview

A selectable item within an SDLChoiceSet

text

Maps to Choice.menuName. The primary text of the cell. Duplicates within an SDLChoiceSet are not permitted and will result in the SDLChoiceSet failing to initialize.

Objective-C

@property (nonatomic, copy, readonly) NSString *_Nonnull text;

Swift

var text: String { get }

secondaryText

Maps to Choice.secondaryText. Optional secondary text of the cell, if available. Duplicates within an SDLChoiceSet are permitted.

Objective-C

@property (nonatomic, copy, readonly, nullable) NSString *secondaryText;

Swift

var secondaryText: String? { get }

tertiaryText

Maps to Choice.tertiaryText. Optional tertitary text of the cell, if available. Duplicates within an SDLChoiceSet are permitted.

Objective-C

@property (nonatomic, copy, readonly, nullable) NSString *tertiaryText;

Swift

var tertiaryText: String? { get }

voiceCommands

Maps to Choice.vrCommands. Optional voice commands the user can speak to activate the cell. If not set and the head unit requires it, this will be set to the number in the list that this item appears. However, this would be a very poor experience for a user if the choice set is presented as a voice only interaction or both interaction mode. Therefore, consider not setting this only when you know the choice set will be presented as a touch only interaction.

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<NSString *> *voiceCommands;

Swift

var voiceCommands: [String]? { get }

artwork

Maps to Choice.image. Optional image for the cell. This will be uploaded before the cell is used when the cell is preloaded or presented for the first time.

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLArtwork *artwork;

Swift

var artwork: SDLArtwork? { get }

secondaryArtwork

Maps to Choice.secondaryImage. Optional secondary image for the cell. This will be uploaded before the cell is used when the cell is preloaded or presented for the first time.

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLArtwork *secondaryArtwork;

Swift

var secondaryArtwork: SDLArtwork? { get }

uniqueText

Primary text of the cell to be displayed on the module. Used to distinguish cells with the same text but other fields are different. This is autogenerated by the screen manager. Attempting to use cells that are exactly the same (all text and artwork fields are the same) will not cause this to be used. This will not be used when connected to modules supporting RPC 7.1+.

Objective-C

@property (nonatomic, strong, readonly) NSString *_Nonnull uniqueText;

Swift

var uniqueText: String { get }

-init

Initialize the cell with nothing. This is unavailable

Objective-C

- (nonnull instancetype)init;

Return Value

A crash, probably

-initWithText:

Initialize the cell with text and nothing else.

Objective-C

- (nonnull instancetype)initWithText:(nonnull NSString *)text;

Swift

init(text: String)

Parameters

text

The primary text of the cell.

Return Value

The cell

-initWithText:artwork:voiceCommands:

Initialize the cell with text, optional artwork, and optional voice commands

Objective-C

- (nonnull instancetype)initWithText:(nonnull NSString *)text
                             artwork:(nullable SDLArtwork *)artwork
                       voiceCommands:
                           (nullable NSArray<NSString *> *)voiceCommands;

Swift

init(text: String, artwork: SDLArtwork?, voiceCommands: [String]?)

Parameters

text

The primary text of the cell

artwork

The primary artwork of the cell

voiceCommands

Strings that can be spoken by the user to activate this cell in a voice or both interaction mode

Return Value

The cell

-initWithText:secondaryText:tertiaryText:voiceCommands:artwork:secondaryArtwork:

Initialize the cell with all optional items

Objective-C

- (nonnull instancetype)initWithText:(nonnull NSString *)text
                       secondaryText:(nullable NSString *)secondaryText
                        tertiaryText:(nullable NSString *)tertiaryText
                       voiceCommands:
                           (nullable NSArray<NSString *> *)voiceCommands
                             artwork:(nullable SDLArtwork *)artwork
                    secondaryArtwork:(nullable SDLArtwork *)secondaryArtwork;

Swift

init(text: String, secondaryText: String?, tertiaryText: String?, voiceCommands: [String]?, artwork: SDLArtwork?, secondaryArtwork: SDLArtwork?)

Parameters

text

The primary text

secondaryText

The secondary text

tertiaryText

The tertiary text

voiceCommands

Strings that can be spoken by the user to activate this cell in a voice or both interaction mode

artwork

The primary artwork

secondaryArtwork

The secondary artwork

Return Value

The cell

View on GitHub.com
Previous Section Next Section