An alert view to be displayed on the remote module. Pass this object to the SDLScreenManager to display.
Set this to change the default timeout for all alerts. If a timeout is not set on an individual alert object (or if it is set to 0.0), then it will use this timeout instead. See timeout
for more details. If this is not set by you, it will default to 5 seconds. The minimum is 3 seconds, the maximum is 10 seconds. If this is set below the minimum, it will be capped at 3 seconds. If this is set above the maximum, it will be capped at 10 seconds.
Please note that if a button is added to the alert, the defaultTimeout and timeout values will be ignored.
@property (class, nonatomic) NSTimeInterval defaultTimeout;
class var defaultTimeout: TimeInterval { get set }
The primary line of text for display on the alert. If fewer than three alert lines are available on the head unit, the screen manager will automatically concatenate some of the lines together.
@property (nonatomic, strong, nullable) NSString *text;
var text: String? { get set }
The secondary line of text for display on the alert. If fewer than three alert lines are available on the head unit, the screen manager will automatically concatenate some of the lines together.
@property (nonatomic, strong, nullable) NSString *secondaryText;
var secondaryText: String? { get set }
The tertiary line of text for display on the alert. If fewer than three alert lines are available on the head unit, the screen manager will automatically concatenate some of the lines together.
@property (nonatomic, strong, nullable) NSString *tertiaryText;
var tertiaryText: String? { get set }
Timeout in seconds. Defaults to 0, which will use defaultTimeout
. If this is set below the minimum, it will be capped at 3 seconds. Minimum 3 seconds, maximum 10 seconds. If this is set above the maximum, it will be capped at 10 seconds. Defaults to 0.
Please note that if a button is added to the alert, the defaultTimeout and timeout values will be ignored.
@property (nonatomic) NSTimeInterval timeout;
var timeout: TimeInterval { get set }
Text spoken, file(s) played, and/or tone played when the alert appears
@property (nonatomic, copy, nullable) SDLAlertAudioData *audio;
@NSCopying var audio: SDLAlertAudioData? { get set }
If supported, the alert GUI will display some sort of indefinite waiting / refresh / loading indicator animation. Defaults to NO.
@property (nonatomic) BOOL showWaitIndicator;
var showWaitIndicator: Bool { get set }
Soft buttons the user may select to perform actions. Only one SDLSoftButtonState
per object is supported; if any soft button object contains multiple states, an exception will be thrown.
@property (nonatomic, copy, nullable) NSArray<SDLSoftButtonObject *> *softButtons;
var softButtons: [SDLSoftButtonObject]? { get set }
An artwork that will be displayed when the icon appears. This will be uploaded prior to the appearance of the alert if necessary. This will not be uploaded if the head unit does not declare support for alertIcon.
@property (nonatomic, copy, nullable) SDLArtwork *icon;
@NSCopying var icon: SDLArtwork? { get set }
Use one of the other init methods
- (nonnull instancetype)init;
init()
Initialize a basic alert with a message and buttons
- (nonnull instancetype)initWithText:(nonnull NSString *)text
buttons:(nonnull NSArray<SDLSoftButtonObject *> *)
softButtons;
convenience init(text: String, buttons softButtons: [SDLSoftButtonObject])
The primary line of text for display on the alert
Soft buttons the user may select to perform actions
Initialize a alert with a text, image, buttons and sound
- (nonnull instancetype)
initWithText:(nullable NSString *)text
secondaryText:(nullable NSString *)secondaryText
tertiaryText:(nullable NSString *)tertiaryText
timeout:(nullable NSNumber<SDLFloat> *)timeout
showWaitIndicator:(nullable NSNumber<SDLBool> *)showWaitIndicator
audioIndication:(nullable SDLAlertAudioData *)audio
buttons:(nullable NSArray<SDLSoftButtonObject *> *)softButtons
icon:(nullable SDLArtwork *)icon;
convenience init(text: String?, secondaryText: String?, tertiaryText: String?, timeout: (NSNumber & SDLFloat)?, showWaitIndicator: (NSNumber & SDLBool)?, audioIndication audio: SDLAlertAudioData?, buttons softButtons: [SDLSoftButtonObject]?, icon: SDLArtwork?)
The primary line of text for display on the alert
The secondary line of text for display on the alert
The tertiary line of text for display on the alert
Timeout in seconds
If supported, the alert GUI will display some sort of indefinite waiting / refresh / loading indicator animation
Text spoken and/or tone played when the alert appears
Soft buttons the user may select to perform actions
An artwork that will be displayed when the icon appears
Cancels the alert. If the alert has not yet been sent to the module, it will not be sent. If the alert is already presented on the module, the alert will be immediately dismissed. Canceling an already presented alert will only work if connected to modules supporting RPC Spec v.6.0+. On older versions the alert will not be dismissed.
- (void)cancel;
func cancel()