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
SDLMenuCell

SDLMenuCell Class Reference

Section Contents

Overview

A menu cell item for the main menu or sub-menu.

title

The cell’s text to be displayed

Objective-C

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

Swift

var title: String { get }

icon

The cell’s icon to be displayed

Objective-C

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

Swift

var icon: SDLArtwork? { get }

voiceCommands

The strings the user can say to activate this voice command

Objective-C

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

Swift

var voiceCommands: [String]? { get }

handler

The handler that will be called when the command is activated

Objective-C

@property (nonatomic, copy, readonly, nullable) SDLMenuCellSelectionHandler handler;

Swift

var handler: SDLMenuCellSelectionHandler? { get }

subCells

If this is non-nil, this cell will be a sub-menu button, displaying the subcells in a menu when pressed.

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<SDLMenuCell *> *subCells;

Swift

var subCells: [SDLMenuCell]? { get }

submenuLayout

The layout in which the subCells will be displayed.

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLMenuLayout submenuLayout;

Swift

var submenuLayout: SDLMenuLayout? { get }

uniqueTitle

Primary text of the cell to be displayed on the module. Used to distinguish cells with the same title but other fields are different. This is autogenerated by the screen manager. This will not be used when connected to modules supporting RPC 7.1+ because duplicate titles are supported.

Objective-C

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

Swift

var uniqueTitle: String { get }

secondaryText

The cell’s secondary text to be displayed

Objective-C

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

Swift

var secondaryText: String? { get }

tertiaryText

The cell’s tertiary text to be displayed

Objective-C

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

Swift

var tertiaryText: String? { get }

secondaryArtwork

The cell’s secondary icon to be displayed

Objective-C

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

Swift

var secondaryArtwork: SDLArtwork? { get }

-initWithTitle:icon:voiceCommands:handler:

Create a menu cell that has no subcells.

Objective-C

- (nonnull instancetype)
    initWithTitle:(nonnull NSString *)title
             icon:(nullable SDLArtwork *)icon
    voiceCommands:(nullable NSArray<NSString *> *)voiceCommands
          handler:(nonnull SDLMenuCellSelectionHandler)handler;

Swift

init(title: String, icon: SDLArtwork?, voiceCommands: [String]?, handler: @escaping SDLMenuCellSelectionHandler)

Parameters

title

The cell’s primary text

icon

The cell’s image

voiceCommands

Voice commands that will activate the menu cell

handler

The code that will be run when the menu cell is selected

Return Value

The menu cell

-initWithTitle:icon:submenuLayout:subCells:

Create a menu cell that has subcells and when selected will go into a deeper part of the menu

Objective-C

- (nonnull instancetype)initWithTitle:(nonnull NSString *)title
                                 icon:(nullable SDLArtwork *)icon
                        submenuLayout:(nullable SDLMenuLayout)layout
                             subCells:
                                 (nonnull NSArray<SDLMenuCell *> *)subCells;

Swift

init(title: String, icon: SDLArtwork?, submenuLayout layout: SDLMenuLayout?, subCells: [SDLMenuCell])

Parameters

title

The cell’s primary text

icon

The cell’s image

layout

The layout that the subCells will be laid out in if that submenu is entered

subCells

The subcells that will appear when the cell is selected

Return Value

The menu cell

-initWithTitle:secondaryText:tertiaryText:icon:secondaryArtwork:voiceCommands:handler:

Create a menu cell that has no subcells.

Objective-C

- (nonnull instancetype)
       initWithTitle:(nonnull NSString *)title
       secondaryText:(nullable NSString *)secondaryText
        tertiaryText:(nullable NSString *)tertiaryText
                icon:(nullable SDLArtwork *)icon
    secondaryArtwork:(nullable SDLArtwork *)secondaryArtwork
       voiceCommands:(nullable NSArray<NSString *> *)voiceCommands
             handler:(nonnull SDLMenuCellSelectionHandler)handler;

Swift

init(title: String, secondaryText: String?, tertiaryText: String?, icon: SDLArtwork?, secondaryArtwork: SDLArtwork?, voiceCommands: [String]?, handler: @escaping SDLMenuCellSelectionHandler)

Parameters

title

The cell’s primary text

secondaryText

- secondaryText

tertiaryText

- tertiaryText

icon

The cell’s image

secondaryArtwork

- secondaryArtwork

voiceCommands

Voice commands that will activate the menu cell

handler

The code that will be run when the menu cell is selected

Return Value

The menu cell

-initWithTitle:secondaryText:tertiaryText:icon:secondaryArtwork:submenuLayout:subCells:

Create a menu cell that has subcells and when selected will go into a deeper part of the menu

Objective-C

- (nonnull instancetype)initWithTitle:(nonnull NSString *)title
                        secondaryText:(nullable NSString *)secondaryText
                         tertiaryText:(nullable NSString *)tertiaryText
                                 icon:(nullable SDLArtwork *)icon
                     secondaryArtwork:(nullable SDLArtwork *)secondaryArtwork
                        submenuLayout:(nullable SDLMenuLayout)layout
                             subCells:
                                 (nonnull NSArray<SDLMenuCell *> *)subCells;

Swift

init(title: String, secondaryText: String?, tertiaryText: String?, icon: SDLArtwork?, secondaryArtwork: SDLArtwork?, submenuLayout layout: SDLMenuLayout?, subCells: [SDLMenuCell])

Parameters

title

The cell’s primary text

secondaryText

- secondaryText

tertiaryText

- tertiaryText

icon

The cell’s image

secondaryArtwork

- secondaryArtwork

layout

The layout that the subCells will be laid out in if that submenu is entered

subCells

The subcells that will appear when the cell is selected

Return Value

The menu cell

View on GitHub.com
Previous Section Next Section