Skip to main content

SwipeableViewDelegate

Delegate responsible for easily assigning swipe action buttons to collectionView cells.

public protocol SwipeableViewDelegate: AnyObject 

Inheritance

AnyObject

Requirements

swipeableViewWillShowActionViews(for:​)

Prepares the receiver that showing of actionViews will occur. use this method to for example close other actionViews in your collectionView/tableView.

func swipeableViewWillShowActionViews(for indexPath: IndexPath)

Parameters

  • indexPath: IndexPath of collectionViewCell which asks for action buttons.

swipeableViewActionViews(for:​)

ChatChannelListCollectionViewCell can have swipe to delete / reveal action buttons on the cell.

func swipeableViewActionViews(for indexPath: IndexPath) -> [UIView]

implementation of method should create those buttons and actions and be assigned easily to the cell in UICollectionViewDataSource.cellForItemAtIndexPath function.

  • Returns array of buttons revealed by swipe deletion.

Parameters

  • indexPath: IndexPath of collectionViewCell which asks for action buttons.

Did you find this page helpful?