SwipeTableViewCellDelegate
public protocol SwipeTableViewCellDelegate: class
The SwipeTableViewCellDelegate protocol is adopted by an object that manages the display of action buttons when the cell is swiped.
-
Asks the delegate for the actions to display in response to a swipe in the specified row.
Declaration
Swift
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]?Parameters
tableViewThe table view object which owns the cell requesting this information.
indexPathThe index path of the row.
orientationThe side of the cell requesting this information.
Return Value
An array of
SwipeActionobjects representing the actions for the row. Each action you provide is used to create a button that the user can tap. Returningnilwill prevent swiping for the supplied orientation. -
tableView(_:editActionsOptionsForRowAt:for:)Default implementationAsks the delegate for the display options to be used while presenting the action buttons.
Note
If not implemented, a default
SwipeOptionsinstance is used.Default Implementation
Declaration
Swift
func tableView(_ tableView: UITableView, editActionsOptionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeOptionsParameters
tableViewThe table view object which owns the cell requesting this information.
indexPathThe index path of the row.
orientationThe side of the cell requesting this information.
Return Value
A
SwipeOptionsinstance which configures the behavior of the action buttons. -
tableView(_:willBeginEditingRowAt:for:)Default implementationTells the delegate that the table view is about to go into editing mode.
Default Implementation
Declaration
Swift
func tableView(_ tableView: UITableView, willBeginEditingRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation)Parameters
tableViewThe table view object providing this information.
indexPathThe index path of the row.
orientationThe side of the cell.
-
tableView(_:didEndEditingRowAt:for:)Default implementationTells the delegate that the table view has left editing mode.
Default Implementation
Declaration
Swift
func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?, for orientation: SwipeActionsOrientation)Parameters
tableViewThe table view object providing this information.
indexPathThe index path of the row.
orientationThe side of the cell.
-
visibleRect(for:)Default implementationAsks the delegate for visibile rectangle of the table view, which is used to ensure swipe actions are vertically centered within the visible portion of the cell.
Note
The returned rectange should be in the table view’s own coordinate system. Returning
nilwill result in no vertical offset to be be calculated.Default Implementation
Declaration
Swift
func visibleRect(for tableView: UITableView) -> CGRect?Parameters
tableViewThe table view object providing this information.
Return Value
The visible rectangle of the table view.
View on GitHub
SwipeTableViewCellDelegate Protocol Reference