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

SDLMenuCell Class Reference

Section Contents

Overview

Undocumented

title

The cell’s text to be displayed

Objective-C

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

Swift

var title: String { get }

icon

The cell’s icon to be displayed

Objective-C

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

Swift

var icon: SDLArtwork? { get }

voiceCommands

The strings the user can say to activate this voice command

Objective-C

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

Swift

var voiceCommands: [String]? { get }

handler

The handler that will be called when the command is activated

Objective-C

@property (readonly, copy, nonatomic, 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 (readonly, copy, nonatomic, nullable) NSArray<SDLMenuCell *> *subCells;

Swift

var subCells: [SDLMenuCell]? { 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: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
                             subCells:
                                 (nonnull NSArray<SDLMenuCell *> *)subCells;

Swift

init(title: String, subCells: [SDLMenuCell])

Parameters

title

The cell’s primary text

subCells

The subcells that will appear when the cell is selected

Return Value

The menu cell

-initWithTitle:icon: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
                             subCells:
                                 (nonnull NSArray<SDLMenuCell *> *)subCells;

Swift

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

Parameters

title

The cell’s primary text

icon

The cell’s image

subCells

The subcells that will appear when the cell is selected

Return Value

The menu cell

View on GitHub.com
Previous Section Next Section