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 call SwipeAction.fulfill(style:) to resolve the fill expansion.

    Declaration

    Swift

    public static var fill: SwipeExpansionStyle
  • Returns a SwipeExpansionStyle instance for the default action which peforms destructive behavior with the specified options.

    Declaration

    Swift

    public static func destructive(automaticallyDelete: Bool, timing: FillOptions.HandlerInvocationTiming = .with) -> SwipeExpansionStyle

    Parameters

    automaticallyDelete

    Specifies if row/item deletion should be peformed automatically. If false, you must call SwipeAction.fulfill(with style:) at some point while/after your action handler is invoked to trigger deletion.

    timing

    The timing which specifies when the action handler will be invoked with respect to the fill animation.

    Return Value

    The new SwipeExpansionStyle instance.

  • 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 SwipeExpansionStyle instance.

    Declaration

    Swift

    public init(target: Target, additionalTriggers: [Trigger] = [], elasticOverscroll: Bool = false, completionAnimation: CompletionAnimation = .bounce)

    Parameters

    target

    The relative target expansion threshold. Expansion will occur at the specified value.

    additionalTriggers

    Additional triggers to useful for determining if expansion should occur.

    elasticOverscroll

    Specifies if buttons should expand to fully fill overscroll, or expand at a percentage relative to the overscroll.

    completionAnimation

    Specifies the expansion animation completion style.

    Return Value

    The new SwipeExpansionStyle instance.

  • Describes the relative target expansion threshold. Expansion will occur at the specified value.

    See more

    Declaration

    Swift

    public enum Target
  • Describes additional triggers to useful for determining if expansion should occur.

    See more

    Declaration

    Swift

    public enum Trigger
  • Describes the expansion animation completion style.

    See more

    Declaration

    Swift

    public enum CompletionAnimation
  • Specifies the options for the fill completion animation.

    See more

    Declaration

    Swift

    public struct FillOptions