diff options
author | NicoleYarroch <nicole@livio.io> | 2020-06-23 10:38:52 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2020-06-23 10:38:52 -0400 |
commit | 0d2b18c8c63ba656f1b941acb481875d4f10b199 (patch) | |
tree | 08386d135de273efdd0665678f9c04796a9cf945 | |
parent | 1886ce7f99e43ec82d011d65fb535592f3a1ec46 (diff) | |
download | sdl_ios-0d2b18c8c63ba656f1b941acb481875d4f10b199.tar.gz |
Fixed documentation
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r-- | SmartDeviceLink/SDLScreenManager.h | 10 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSubscribeButtonManager.h | 18 |
2 files changed, 14 insertions, 14 deletions
diff --git a/SmartDeviceLink/SDLScreenManager.h b/SmartDeviceLink/SDLScreenManager.h index f241b7680..78349ef58 100644 --- a/SmartDeviceLink/SDLScreenManager.h +++ b/SmartDeviceLink/SDLScreenManager.h @@ -260,13 +260,13 @@ If set to `SDLDynamicMenuUpdatesModeForceOff`, menu updates will work the legacy #pragma mark - Subscribe Buttons -/// Subscribes to the specified hard button. The update handler will be called when the button has been selected. -/// To unsubscribe to the hard button, please call `unsubscribeButton:withObserver:withCompletionHandler:`. +/// Subscribes to a subscribe button. The update handler will be called when the button has been selected. If there is an error subscribing to the subscribe button it will be returned in the `error` parameter of the updateHandler. /// @param buttonName The name of the hard button to subscribe to -/// @param updateHandler A handler called when a response to the subscription request has been received from the module and when the button has been selected +/// @param updateHandler The block run when the subscribe button is selected +/// @return An object that can be used to unsubscribe the block using `unsubscribeButtonWithObserver:withCompletionHandler:`. - (id<NSObject>)subscribeButton:(SDLButtonName)buttonName withUpdateHandler:(SDLSubscribeButtonHandler)updateHandler; -/// Subscribes to the specified hard button. The selector will be called when the button has been selected. +/// Subscribes to a subscribe button. The selector will be called when the button has been selected. If there is an error subscribing to the subscribe button it will be returned in the `error` parameter of the selector. /// /// The selector supports the following parameters: /// @@ -287,7 +287,7 @@ If set to `SDLDynamicMenuUpdatesModeForceOff`, menu updates will work the legacy /// @param selector The selector on `observer` that will be called whenever the button has been selected - (void)subscribeButton:(SDLButtonName)buttonName withObserver:(id<NSObject>)observer selector:(SEL)selector; -/// Unsubscribes to the specified hard button. Please note that if a hard button has multiple subscribers the observer will no longer get notifications, however, the app will still be subscribed to the hard button until the last subscriber is removed. +/// Unsubscribes to a subscribe button. Please note that if a subscribe button has multiple subscribers the observer will no longer get notifications, however, the app will still be subscribed to the hard button until the last subscriber is removed. /// @param buttonName The name of the hard button to subscribe to /// @param observer The object that will be unsubscribed. If a block was subscribed, the return value should be passed. If a selector was subscribed, the observer object should be passed /// @param completionHandler A handler called when the observer has been unsubscribed to the hard button diff --git a/SmartDeviceLink/SDLSubscribeButtonManager.h b/SmartDeviceLink/SDLSubscribeButtonManager.h index 83a414a75..d077fe804 100644 --- a/SmartDeviceLink/SDLSubscribeButtonManager.h +++ b/SmartDeviceLink/SDLSubscribeButtonManager.h @@ -14,17 +14,17 @@ NS_ASSUME_NONNULL_BEGIN -/// A handler run when the subscribe button has been selected +/// A handler run when the subscribe button has been selected. /// @param buttonPress Indicates whether this is a long or short button press event /// @param buttonEvent Indicates whether the button has been depressed or released /// @param error The error, if one occurred, during the subscription typedef void (^SDLSubscribeButtonUpdateHandler)(SDLOnButtonPress *_Nullable buttonPress, SDLOnButtonEvent *_Nullable buttonEvent, NSError *_Nullable error); -/// The handler run when the update has completed +/// The handler run when the update has completed. /// @param error An error if the update failed typedef void(^SDLSubscribeButtonUpdateCompletionHandler)(NSError *__nullable error); -/// TODO - class description +/// Manager for handling subscriptions to hard buttons. @interface SDLSubscribeButtonManager : NSObject /// Initialize the manager with required dependencies. @@ -37,22 +37,22 @@ typedef void(^SDLSubscribeButtonUpdateCompletionHandler)(NSError *__nullable err /// Stops the manager. This method is used internally. - (void)stop; -/// Subscribes to a subscribe button with the button name. +/// Subscribes to a subscribe button. /// @param buttonName The name of the subscribe button -/// @param updateHandler The block run when the subscribe button is selected -/// @return An object that can be used to unsubscribe the block using `unsubscribeButtonWithObserver:withCompletionHandler:`. If `nil` the manager was not able attempt the subscription for some reason. +/// @param updateHandler The block run when the subscribe button is selected. If there is an error subscribing to the subscribe button it will be returned in the `error` parameter. +/// @return An object that can be used to unsubscribe the block using `unsubscribeButtonWithObserver:withCompletionHandler:`. - (id<NSObject>)subscribeButton:(SDLButtonName)buttonName withUpdateHandler:(nullable SDLSubscribeButtonUpdateHandler)updateHandler; -/// Subscribes to a subscribe button with the button name. +/// Subscribes to a subscribe button. /// @param buttonName The name of the subscribe button /// @param observer The object that will have `selector` called whenever the subscribe button is selected /// @param selector The selector on `observer` that will be called whenever the subscribe button is selected - (void)subscribeButton:(SDLButtonName)buttonName withObserver:(id<NSObject>)observer selector:(SEL)selector; -/// Unsubscribes to a subscribed subscribe button. +/// Unsubscribes to a subscribe button. /// @param buttonName The name of the subscribe button /// @param observer The object that will be unsubscribed. If a block was subscribed, the value returned by the subscription method should be passed. If a selector was subscribed, the observer object should be passed. -/// @param completionHandler The block run when the subscribe button is unsubscribed +/// @param completionHandler The block run when the subscribe button is unsubscribed. If there is an error unsubscribing to the subscribe button it will be returned in the `error` parameter. - (void)unsubscribeButton:(SDLButtonName)buttonName withObserver:(id<NSObject>)observer withCompletionHandler:(nullable SDLSubscribeButtonUpdateCompletionHandler)completionHandler; @end |