SCSActionItemContainer
@protocol SCSActionItemContainer <NSObject>
Protocol defining a type of UIViewController
that can be used to display SCSActionItem
objects.
See
SCSActionManager
-
Adds an action view for the given name.
This will insert the view into the view hierarchy, and will include it sorted with the set of views if applicable. A built-in animation is provided if the animated property is
YES
.Declaration
Objective-C
- (void)addActionView:(nonnull UIView<SCSActionItem> *)view forName:(nonnull SCSAction)name atSortIndex:(NSInteger)sortIndex animated:(BOOL)animated;
Parameters
view
The action view to add.
name
The name of the action.
sortIndex
Preferred sort position relative to other views, or
NSNotFound
for no preference.animated
Indicates if the addition should be animated.
-
Removes the action view with the given name.
Declaration
Objective-C
- (void)removeActionViewForName:(nonnull SCSAction)name animated:(BOOL)animated;
Swift
func removeActionView(forName name: SCSAction, animated: Bool)
Parameters
name
Name of the action to remove.
animated
Indicates if the removal should be animated.
-
Returns the action view with the given name.
If no action view is visible with that name, this method can return
nil
.Declaration
Objective-C
- (nullable UIView<SCSActionItem> *)actionViewForName:(nonnull SCSAction)name;
Parameters
name
Name of the action.
Return Value
Action view with that name, or
nil
if no view matches that name. -
Indicates whether or not the item container should automatically adjust its visibility when the content on the screen scrolls.
If not implemented, the default is assumed to be
NO
.Declaration
Objective-C
- (BOOL)shouldAdjustVisibilityWhenContentScrolls;
Swift
optional func shouldAdjustVisibilityWhenContentScrolls() -> Bool
Return Value
YES
if scrollable content should cause the action container to show or hide, otherwiseNO
.