CellActions

public struct CellActions

The actions property exposed on the CellConfigType represents possible events that will be executed based on the users interaction with that particular cell. Of note are the selectionAction and previewingViewControllerAction. The selectionAction is executed when the user taps on that particular cell. The main use case for this is present a new detail view controller or a modal (but is not constrained to these actions, these are just the common use cases). The previewingViewControllerAction is responsible for returning an instance of a UIViewController that will be shown when a user 3D-touches on a cell.

  • The possible states a cell can be when a selection action is performed on it.

    Declaration

    Swift

    public enum SelectionState
  • Closure type that is executed when the user 3D-touches on a cell

    Declaration

    Swift

    public typealias PreviewingViewControllerAction = (_ cell: UIView, _ point: CGPoint, _ context: UIViewControllerPreviewing) -> UIViewController?

    Parameters

    cell

    the cell in which the 3D-touch occured

    point

    The point where the 3D-touch occured, translated to the coordinate space of the cell

    context

    The instance of UIViewControllerPreviewing that is participating in the 3D-touch

  • The action to perform when the cell will be selected.

    Important

    When the canSelectAction is called, it is passed a CanSelectCallback closure. It is the responsibility of the action to eventually call the passed in closure providing either a true or false value to it. This passed in value determines if the selection will be performed or not.

    Declaration

    Swift

    public let canSelectAction: CanSelectAction?
  • The action to perform when the cell is selected

    Declaration

    Swift

    public let selectionAction: SelectionAction?
  • The action to perform when the cell is deselected

    Declaration

    Swift

    public let deselectionAction: SelectionAction?
  • All the available row actions this cell can perform. See UITableViewRowAction for more info.

    Declaration

    Swift

    public let rowActions: [UITableViewRowAction]?
  • Indicates if the cell can perform a given action.

    Declaration

    Swift

    public let canPerformAction: CanPerformAction?
  • Indicates if the cell can be manually moved by the user.

    Declaration

    Swift

    public let canBeMoved: Bool
  • The action to perform when the cell becomes visible.

    Declaration

    Swift

    public let visibilityAction: VisibilityAction?
  • The action to perform when the cell is 3D touched by the user.

    Declaration

    Swift

    public let previewingViewControllerAction: PreviewingViewControllerAction?