SwipeExpansionStyle
public struct SwipeExpansionStyle
Describes the expansion style. Expansion is the behavior when the cell is swiped past a defined threshold.
-
The default action performs a selection-type behavior. The cell bounces back to its unopened state upon selection and the row remains in the table/collection view.
Declaration
Swift
public static var selection: SwipeExpansionStyle -
The default action performs a destructive behavior. The cell is removed from the table/collection view in an animated fashion.
Declaration
Swift
public static var destructive: SwipeExpansionStyle -
The default action performs a destructive behavior after the fill animation completes. The cell is removed from the table/collection view in an animated fashion.
Declaration
Swift
public static var destructiveAfterFill: SwipeExpansionStyle -
The default action performs a fill behavior.
Note
The action handle must callSwipeAction.fulfill(style:)to resolve the fill expansion.Declaration
Swift
public static var fill: SwipeExpansionStyle -
Returns a
SwipeExpansionStyleinstance for the default action which peforms destructive behavior with the specified options.Declaration
Swift
public static func destructive(automaticallyDelete: Bool, timing: FillOptions.HandlerInvocationTiming = .with) -> SwipeExpansionStyleParameters
automaticallyDeleteSpecifies if row/item deletion should be peformed automatically. If
false, you must callSwipeAction.fulfill(with style:)at some point while/after your action handler is invoked to trigger deletion.timingThe timing which specifies when the action handler will be invoked with respect to the fill animation.
Return Value
The new
SwipeExpansionStyleinstance. -
The relative target expansion threshold. Expansion will occur at the specified value.
Declaration
Swift
public let target: Target -
Additional triggers to useful for determining if expansion should occur.
Declaration
Swift
public let additionalTriggers: [Trigger] -
Specifies if buttons should expand to fully fill overscroll, or expand at a percentage relative to the overscroll.
Declaration
Swift
public let elasticOverscroll: Bool -
Specifies the expansion animation completion style.
Declaration
Swift
public let completionAnimation: CompletionAnimation -
Specifies the minimum amount of overscroll required if the configured target is less than the fully exposed action view.
Declaration
Swift
public var minimumTargetOverscroll: CGFloat = 20 -
The amount of elasticity applied when dragging past the expansion target.
Note
Default value is 0.2. Valid range is from 0.0 for no movement past the expansion target, to 1.0 for unrestricted movement with dragging.Declaration
Swift
public var targetOverscrollElasticity: CGFloat = 0.2 -
Contructs a new
SwipeExpansionStyleinstance.Declaration
Swift
public init(target: Target, additionalTriggers: [Trigger] = [], elasticOverscroll: Bool = false, completionAnimation: CompletionAnimation = .bounce)Parameters
targetThe relative target expansion threshold. Expansion will occur at the specified value.
additionalTriggersAdditional triggers to useful for determining if expansion should occur.
elasticOverscrollSpecifies if buttons should expand to fully fill overscroll, or expand at a percentage relative to the overscroll.
completionAnimationSpecifies the expansion animation completion style.
Return Value
The new
SwipeExpansionStyleinstance.
-
Describes the relative target expansion threshold. Expansion will occur at the specified value.
See moreDeclaration
Swift
public enum Target -
Describes additional triggers to useful for determining if expansion should occur.
See moreDeclaration
Swift
public enum Trigger -
Describes the expansion animation completion style.
See moreDeclaration
Swift
public enum CompletionAnimation -
Specifies the options for the fill completion animation.
See moreDeclaration
Swift
public struct FillOptions
View on GitHub
SwipeExpansionStyle Structure Reference