SCSActionManagerDelegate
@protocol SCSActionManagerDelegate <NSObject>
Delegate protocol used by the SCSActionManager to customize the appearance and functionality of the action manager.
-
Asks the delegate for a view controller to present action buttons to the user when it is about to be presented.
This method should only be used when a developer wishes to customize the appearance of the action buttons, or when the action display controller should be disallowed.
If no action buttons should be displayed to the user, this method can return
nil.If this is a view controller, it will be presented in the UI for you. Otherwise, your application is responsible for managing the display of these items yourself.
Declaration
Objective-C
- (nullable __kindof UIViewController<SCSActionItemContainer> *) actionManagerContainerViewController:(nonnull SCSActionManager *)actionManager;Swift
optional func actionManagerContainerViewController(_ actionManager: SCSActionManager) -> Any!Parameters
actionManagerSCSActionManagerinstance.Return Value
Constructed UIViewController instance, conforming to the
SCSActionItemContainerprotocol, ornilif no action button controller should be shown. -
Asks the delegate to supply a custom view for the action of the given name. If the return value is
nil, the default system-provided view will be used, if any.The view is expected to trigger the action as needed using the
-[SCSActionManager performActionWithName:actionItem:].Declaration
Objective-C
- (nullable __kindof UIView<SCSActionItem> *) actionManager:(nonnull SCSActionManager *)actionManager viewForActionItemWithName:(nonnull SCSAction)name;Swift
optional func actionManager(_ actionManager: SCSActionManager, viewForActionItemWithName name: SCSAction) -> Any!Parameters
actionManagerSCSActionManagerinstance.nameAction name.
Return Value
UIViewconforming toSCSActionItemto represent the given action, ornilto accept the system default. -
Asks the delegate to indicate the relative sort positioning of the given action item.
Declaration
Objective-C
- (NSInteger)actionManager:(nonnull SCSActionManager *)actionManager sortIndexForActionItemWithName:(nonnull SCSAction)name;Swift
optional func actionManager(_ actionManager: SCSActionManager, sortIndexForActionItemWithName name: SCSAction) -> IntParameters
actionManagerSCSActionManagerinstance.nameAction name.
Return Value
Integer value indicating the sort position of the given action.
-
Asks the delegate for the set of named actions that should be shown when the given controller is presented. If this method is not implemented a set of defaults is automatically determined. This default set of actions is supplied to this method to allow the default behavior to be maintained when needed, or to extend or subtract from the default set.
When no controllers are visible, the
controllerproperty may benil.Declaration
Objective-C
- (nullable NSSet<SCSAction> *) actionManager:(nonnull SCSActionManager *)actionManager actionsToShowForViewController:(nullable UIViewController *)controller withDefaultActions:(nonnull NSSet<SCSAction> *)defaultActions;Swift
optional func actionManager(_ actionManager: SCSActionManager, actionsToShowForViewController controller: Any!, withDefaultActions defaultActions: Set<SCSAction>) -> Set<SCSAction>?Parameters
actionManagerSCSActionManagerinstance.controllerThe controller that is being presented, or
nilif the last controller has been dismised.defaultActionsThe default actions that would be displayed for this given controller.
Return Value
Set of string action item names to display.
-
Asks the delegate whether or not the action container should be shown when the given controller becomes visible. This provides the delegate with the opportunity to conditionally show or hide the action items when the visible state of the Service SDK changes.
If the resulting container visibility is different from the current state, the appropriate change will be made, and the accompanying
-[SCSActionManagerDelegate actionManager:containerWillChangeVisibility:animated:]and-[SCSActionManagerDelegate actionManager:containerDidChangeVisibility:animated:]methods will be invoked as needed.If the supplied controller’s presentation, or dismissal, is animated, this will result in the action container’s visibility change being animated as well.
Declaration
Objective-C
- (BOOL)actionManager:(nonnull SCSActionManager *)actionManager shouldShowContainerForViewController: (nullable UIViewController *)controller;Swift
optional func actionManager(_ actionManager: SCSActionManager, shouldShowContainerForViewController controller: Any!) -> BoolParameters
actionManagerThe action manager instance.
controllerThe controller about to be presented, or
nilif the last controller is being dismissed.Return Value
YESif the container should be visible, otherwiseNOif the action container should be hidden. -
Message sent to the delegate when the action container will change its visibility, either to be shown or hidden.
Declaration
Objective-C
- (void)actionManager:(nonnull SCSActionManager *)actionManager containerWillChangeVisibility:(BOOL)visible animated:(BOOL)animated;Swift
optional func actionManager(_ actionManager: SCSActionManager, containerWillChangeVisibility visible: Bool, animated: Bool)Parameters
actionManagerThe action manager instance.
visibleYESif the action container will become visible, otherwiseNOif the action bar will become hidden.animatedYESif the visibility change will be animated. -
Message sent to the delegate after the action container has changed its visibility, either to be shown or hidden.
Declaration
Objective-C
- (void)actionManager:(nonnull SCSActionManager *)actionManager containerDidChangeVisibility:(BOOL)visible animated:(BOOL)animated;Swift
optional func actionManager(_ actionManager: SCSActionManager, containerDidChangeVisibility visible: Bool, animated: Bool)Parameters
actionManagerThe action manager instance.
visibleYESif the action container became visible, otherwiseNOif the action bar is hidden.animatedYESif the visibility change was animated. -
Declaration
Objective-C
- (BOOL)actionManager:(nonnull SCSActionManager *)actionManager performActionWithName:(nonnull SCSAction)actionName actionItem:(nullable UIView<SCSActionItem> *)actionItem;Swift
optional func actionManager(_ actionManager: SCSActionManager, performActionWithName actionName: SCSAction, actionItem: Any!) -> BoolReturn Value
YESif the action was handled, orNOif the default behavior should be performed for this action. -
Asks the delegate whether the specified action button should be present.
Declaration
Objective-C
- (BOOL)actionManager:(nonnull SCSActionManager *)actionManager shouldShowActionWithName:(nonnull SCSAction)name;Swift
optional func actionManager(_ actionManager: SCSActionManager, shouldShowActionWithName name: SCSAction) -> BoolParameters
actionManagerSCSActionManagerinstance.nameName representing the action in question.
Return Value
YESif the action button should be visible;NOif the action button should be omitted.
Install in Dash
SCSActionManagerDelegate Protocol Reference