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

SDLScreenManager Class Reference

Section Contents

Overview

Undocumented

textField1

The top text field within a template layout

Objective-C

@property (readwrite, copy, nonatomic, nullable) NSString *textField1;

Swift

var textField1: String? { get set }

textField2

The second text field within a template layout

Objective-C

@property (readwrite, copy, nonatomic, nullable) NSString *textField2;

Swift

var textField2: String? { get set }

textField3

The third text field within a template layout

Objective-C

@property (readwrite, copy, nonatomic, nullable) NSString *textField3;

Swift

var textField3: String? { get set }

textField4

The fourth text field within a template layout

Objective-C

@property (readwrite, copy, nonatomic, nullable) NSString *textField4;

Swift

var textField4: String? { get set }

mediaTrackTextField

The media text field available within the media layout. Often less emphasized than textField(1-4)

Objective-C

@property (readwrite, copy, nonatomic, nullable) NSString *mediaTrackTextField;

Swift

var mediaTrackTextField: String? { get set }

primaryGraphic

The primary graphic within a template layout

Objective-C

@property (readwrite, strong, nonatomic, nullable) SDLArtwork *primaryGraphic;

Swift

var primaryGraphic: SDLArtwork? { get set }

secondaryGraphic

A secondary graphic used in some template layouts

Objective-C

@property (readwrite, strong, nonatomic, nullable) SDLArtwork *secondaryGraphic;

Swift

var secondaryGraphic: SDLArtwork? { get set }

textAlignment

What alignment textField(1-4) should use

Objective-C

@property (readwrite, copy, nonatomic) SDLTextAlignment _Nonnull textAlignment;

Swift

var textAlignment: SDLTextAlignment { get set }

textField1Type

The type of data textField1 describes

Objective-C

@property (readwrite, copy, nonatomic, nullable) SDLMetadataType textField1Type;

Swift

var textField1Type: SDLMetadataType? { get set }

textField2Type

The type of data textField2 describes

Objective-C

@property (readwrite, copy, nonatomic, nullable) SDLMetadataType textField2Type;

Swift

var textField2Type: SDLMetadataType? { get set }

textField3Type

The type of data textField3 describes

Objective-C

@property (readwrite, copy, nonatomic, nullable) SDLMetadataType textField3Type;

Swift

var textField3Type: SDLMetadataType? { get set }

textField4Type

The type of data textField4 describes

Objective-C

@property (readwrite, copy, nonatomic, nullable) SDLMetadataType textField4Type;

Swift

var textField4Type: SDLMetadataType? { get set }

softButtonObjects

The current list of soft buttons within a template layout. Set this array to change the displayed soft buttons.

Objective-C

@property (readwrite, copy, nonatomic)
    NSArray<SDLSoftButtonObject *> *_Nonnull softButtonObjects;

Swift

var softButtonObjects: [SDLSoftButtonObject] { get set }

menu

The current list of menu cells displayed in the app’s menu.

Objective-C

@property (readwrite, copy, nonatomic) NSArray<SDLMenuCell *> *_Nonnull menu;

Swift

var menu: [SDLMenuCell] { get set }

voiceCommands

The current list of voice commands available for the user to speak and be recognized by the IVI’s voice recognition engine.

Objective-C

@property (readwrite, copy, nonatomic)
    NSArray<SDLVoiceCommand *> *_Nonnull voiceCommands;

Swift

var voiceCommands: [SDLVoiceCommand] { get set }

keyboardConfiguration

The default keyboard configuration, this can be additionally customized by each SDLKeyboardDelegate.

Objective-C

@property (readwrite, strong, nonatomic, null_resettable)
    SDLKeyboardProperties *keyboardConfiguration;

Swift

var keyboardConfiguration: SDLKeyboardProperties! { get set }

preloadedChoices

Cells will be hashed by their text, image names, and VR command text. When assembling an SDLChoiceSet, you can pull objects from here, or recreate them. The preloaded versions will be used so long as their text, image names, and VR commands are the same.

Objective-C

@property (readonly, copy, nonatomic)
    NSSet<SDLChoiceCell *> *_Nonnull preloadedChoices;

Swift

var preloadedChoices: Set<AnyHashable> { get }

-initWithConnectionManager:fileManager:

Initialize a screen manager

Warning

For internal use

Objective-C

- (nonnull instancetype)
initWithConnectionManager:
    (nonnull id<SDLConnectionManagerType>)connectionManager
              fileManager:(nonnull SDLFileManager *)fileManager;

Parameters

connectionManager

The connection manager used to send RPCs

fileManager

The file manager used to upload files

Return Value

The screen manager

-startWithCompletionHandler:

Starts the manager and all sub-managers

Objective-C

- (void)startWithCompletionHandler:
    (nonnull void (^)(NSError *_Nullable))handler;

Swift

func start(completionHandler handler: @escaping (Error?) -> Void)

Parameters

handler

The handler called when setup is complete

-stop

Stops the manager.

Warning

For internal use

Objective-C

- (void)stop;

Swift

func stop()

-beginUpdates

Delays all screen updates until endUpdatesWithCompletionHandler: is called.

Objective-C

- (void)beginUpdates;

Swift

func beginUpdates()

-endUpdates

Update text fields with new text set into the text field properties. Pass an empty string \@"" to clear the text field.

If the system does not support a full 4 fields, this will automatically be concatenated and properly send the field available.

If 3 lines are available: [field1, field2, field3 - field 4]

If 2 lines are available: [field1 - field2, field3 - field4]

If 1 line is available: [field1 - field2 - field3 - field4]

Also updates the primary and secondary images with new image(s) if new one(s) been set. This method will take care of naming the files (based on a hash). This is assumed to be a non-persistant image.

If it needs to be uploaded, it will be. Once the upload is complete, the on-screen graphic will be updated.

Objective-C

- (void)endUpdates;

Swift

func endUpdates()

-endUpdatesWithCompletionHandler:

Update text fields with new text set into the text field properties. Pass an empty string \@"" to clear the text field.

If the system does not support a full 4 fields, this will automatically be concatenated and properly send the field available.

If 3 lines are available: [field1, field2, field3 - field 4]

If 2 lines are available: [field1 - field2, field3 - field4]

If 1 line is available: [field1 - field2 - field3 - field4]

Also updates the primary and secondary images with new image(s) if new one(s) been set. This method will take care of naming the files (based on a hash). This is assumed to be a non-persistant image.

If it needs to be uploaded, it will be. Once the upload is complete, the on-screen graphic will be updated.

Objective-C

- (void)endUpdatesWithCompletionHandler:
    (nullable SDLScreenManagerUpdateCompletionHandler)handler;

Swift

func endUpdates(completionHandler handler: SDLScreenManagerUpdateCompletionHandler? = nil)

Parameters

handler

A handler run when the fields have finished updating, with an error if the update failed. This handler may be called multiple times when the text update is sent and the image update is sent.

-softButtonObjectNamed:

Undocumented

Objective-C

- (nullable SDLSoftButtonObject *)softButtonObjectNamed:(NSString *)name;

Swift

func softButtonObjectNamed(_ name: String) -> SDLSoftButtonObject?

-preloadChoices:withCompletionHandler:

Preload cells to the head unit. This will greatly reduce the time taken to present a choice set. Any already matching a choice already on the head unit will be ignored. You do not need to wait until the completion handler is called to present a choice set containing choices being loaded. The choice set will wait until the preload completes and then immediately present.

Objective-C

- (void)preloadChoices:(nonnull NSArray<SDLChoiceCell *> *)choices
    withCompletionHandler:(nullable SDLPreloadChoiceCompletionHandler)handler;

Swift

func preloadChoices(_ choices: [SDLChoiceCell], withCompletionHandler handler: SDLPreloadChoiceCompletionHandler? = nil)

Parameters

choices

The choices to be preloaded.

handler

The handler to be called when complete.

-deleteChoices:

Delete loaded cells from the head unit. If the cells don’t exist on the head unit they will be ignored.

Objective-C

- (void)deleteChoices:(nonnull NSArray<SDLChoiceCell *> *)choices;

Swift

func deleteChoices(_ choices: [SDLChoiceCell])

Parameters

choices

The choices to be deleted. These will be matched via a hash of the text, image name(s), and VR commands.

-presentChoiceSet:mode:

Present a choice set on the head unit with a certain interaction mode. You should present in VR only if the user reached this choice set by using their voice, in Manual only if the user used touch to reach this choice set. Use Both if you’re lazy…for real though, it’s kind of confusing to the user and isn’t recommended.

If the cells in the set are not already preloaded, they will be preloaded before the presentation occurs; this could take a while depending on the contents of the cells.

If the cells have voice commands and images attached, this could take upwards of 10 seconds. If there are no cells on the set, this will fail, calling choiceSet:didReceiveError: on the choice set delegate.

Objective-C

- (void)presentChoiceSet:(nonnull SDLChoiceSet *)choiceSet
                    mode:(nonnull SDLInteractionMode)mode;

Swift

func present(_ choiceSet: SDLChoiceSet, mode: SDLInteractionMode)

Parameters

choiceSet

The set to be displayed

mode

If the set should be presented for the user to interact via voice, touch, or both

-presentSearchableChoiceSet:mode:withKeyboardDelegate:

Present a choice set on the head unit with a certain interaction mode. You should present in VR only if the user reached this choice set by using their voice, in Manual only if the user used touch to reach this choice set. Use Both if you’re lazy…for real though, it’s kind of confusing to the user and isn’t recommended.

This presents the choice set as searchable when in a touch interaction. The user, when not in a distracted state, will have a keyboard available for searching this set. The user’s input in the keyboard will be available in the SDLKeyboardDelegate.

If the cells in the set are not already preloaded, they will be preloaded before the presentation occurs; this could take a while depending on the contents of the cells.

If the cells have voice commands and images attached, this could take upwards of 10 seconds. If there are no cells on the set, this will fail, calling choiceSet:didReceiveError: on the choice set delegate.

Objective-C

- (void)presentSearchableChoiceSet:(nonnull SDLChoiceSet *)choiceSet
                              mode:(nonnull SDLInteractionMode)mode
              withKeyboardDelegate:(nonnull id<SDLKeyboardDelegate>)delegate;

Parameters

choiceSet

The set to be displayed

mode

If the set should be presented for the user to interact via voice, touch, or both

delegate

The keyboard delegate called when the user interacts with the search field of the choice set

-presentKeyboardWithInitialText:delegate:

Present a keyboard-only interface to the user and receive input. The user will be able to input text in the keyboard when in a non-driver distraction situation.

Objective-C

- (void)presentKeyboardWithInitialText:(nonnull NSString *)initialText
                              delegate:
                                  (nonnull id<SDLKeyboardDelegate>)delegate;

Parameters

initialText

The initial text within the keyboard input field. It will disappear once the user selects the field in order to enter text

delegate

The keyboard delegate called when the user interacts with the keyboard

View on GitHub.com
Previous Section Next Section