summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-08-07 15:10:28 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-08-07 15:10:28 -0400
commit4b0703159a535911d89a24692a0a37113402ed19 (patch)
tree9f892ed9054a93267e18a3b1192484a1d5e51378
parentf43c7f46c0e535a322afbd76afb312bfa1fdeedc (diff)
downloadsdl_ios-4b0703159a535911d89a24692a0a37113402ed19.tar.gz
Add a single state soft button object without having to create a state object first
-rw-r--r--SmartDeviceLink/SDLSoftButtonObject.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLSoftButtonObject.h b/SmartDeviceLink/SDLSoftButtonObject.h
index fe641a56e..abcb36d46 100644
--- a/SmartDeviceLink/SDLSoftButtonObject.h
+++ b/SmartDeviceLink/SDLSoftButtonObject.h
@@ -58,12 +58,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.