summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLSoftButtonObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/SDLSoftButtonObject.h')
-rw-r--r--SmartDeviceLink/SDLSoftButtonObject.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLSoftButtonObject.h b/SmartDeviceLink/SDLSoftButtonObject.h
index fe641a56e..eb2512fca 100644
--- a/SmartDeviceLink/SDLSoftButtonObject.h
+++ b/SmartDeviceLink/SDLSoftButtonObject.h
@@ -10,6 +10,7 @@
#import "SDLNotificationConstants.h"
+@class SDLArtwork;
@class SDLSoftButton;
@class SDLSoftButtonObject;
@class SDLSoftButtonState;
@@ -58,12 +59,24 @@ NS_ASSUME_NONNULL_BEGIN
Create a single-state soft button. For example, a button that brings up a Perform Interaction menu.
@param name The name of the button
- @param eventHandler The handler to be called when the button is in the current state and is pressed
@param state The single state of the button
+ @param eventHandler The handler to be called when the button is pressed
+ @return The button object
*/
- (instancetype)initWithName:(NSString *)name state:(SDLSoftButtonState *)state handler:(nullable SDLRPCButtonNotificationHandler)eventHandler;
/**
+ Create a single-state soft button. For example, a button that brings up a Perform Interaction menu.
+
+ @param name The name of the button
+ @param text The text to be displayed on the button
+ @param artwork The artwork to be displayed on the button
+ @param eventHandler The handler to be called when the button is pressed
+ @return The button object
+ */
+- (instancetype)initWithName:(NSString *)name text:(nullable NSString *)text artwork:(nullable SDLArtwork *)artwork handler:(nullable SDLRPCButtonNotificationHandler)eventHandler;
+
+/**
Transition the soft button to another state in the `states` property. The wrapper considers all transitions valid (assuming a state with that name exists).
@warning This method will throw an exception and crash your app (on purpose) if you attempt an invalid transition. So...don't do that.