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
actionManager
SCSActionManager
instance.Return Value
Constructed UIViewController instance, conforming to the
SCSActionItemContainer
protocol, ornil
if 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
actionManager
SCSActionManager
instance.name
Action name.
Return Value
UIView
conforming toSCSActionItem
to represent the given action, ornil
to 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) -> Int
Parameters
actionManager
SCSActionManager
instance.name
Action 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
controller
property 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
actionManager
SCSActionManager
instance.controller
The controller that is being presented, or
nil
if the last controller has been dismised.defaultActions
The 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!) -> Bool
Parameters
actionManager
The action manager instance.
controller
The controller about to be presented, or
nil
if the last controller is being dismissed.Return Value
YES
if the container should be visible, otherwiseNO
if 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
actionManager
The action manager instance.
visible
YES
if the action container will become visible, otherwiseNO
if the action bar will become hidden.animated
YES
if 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
actionManager
The action manager instance.
visible
YES
if the action container became visible, otherwiseNO
if the action bar is hidden.animated
YES
if 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!) -> Bool
Return Value
YES
if the action was handled, orNO
if 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) -> Bool
Parameters
actionManager
SCSActionManager
instance.name
Name representing the action in question.
Return Value
YES
if the action button should be visible;NO
if the action button should be omitted.