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
SDLSoftButtonState

SDLSoftButtonState Class Reference

Section Contents

Overview

A soft button state including data such as text, name and artwork

name

The name of this soft button state

Objective-C

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

Swift

var name: String { get }

artwork

The artwork to be used with this button or nil if it is text-only

Objective-C

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

Swift

var artwork: SDLArtwork? { get }

text

The text to be used with this button or nil if it is image-only

Objective-C

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

Swift

var text: String? { get }

highlighted

Whether or not the button should be highlighted on the UI

Objective-C

@property (nonatomic, getter=isHighlighted) BOOL highlighted;

Swift

var isHighlighted: Bool { get set }

systemAction

A special system action

Objective-C

@property (nonatomic, strong) SDLSystemAction _Nonnull systemAction;

Swift

var systemAction: SDLSystemAction { get set }

softButton

An SDLSoftButton describing this state

Objective-C

@property (nonatomic, strong, readonly) SDLSoftButton *_Nonnull softButton;

Swift

var softButton: SDLSoftButton { get }

-init

Initializer unavailable

Objective-C

- (nonnull instancetype)init;

-initWithStateName:text:image:

Create the soft button state. Either the text or artwork or both may be set.

Objective-C

- (nonnull instancetype)initWithStateName:(nonnull NSString *)stateName
                                     text:(nullable NSString *)text
                                    image:(nullable UIImage *)image;

Swift

init(stateName: String, text: String?, image: UIImage?)

Parameters

stateName

The name of this state for the button

text

The text to be displayed on the button

image

The image to be displayed on the button. This is assumed to be a PNG, non-persistant. The name will be the same as the state name.

Return Value

A new soft button state

-initWithStateName:text:artwork:

Create the soft button state. Either the text or artwork or both may be set.

Objective-C

- (nonnull instancetype)initWithStateName:(nonnull NSString *)stateName
                                     text:(nullable NSString *)text
                                  artwork:(nullable SDLArtwork *)artwork;

Swift

init(stateName: String, text: String?, artwork: SDLArtwork?)

Parameters

stateName

The name of this state for the button

text

The text to be displayed on the button

artwork

The artwork to be displayed on the button

Return Value

A new soft button state

View on GitHub.com
Previous Section Next Section