docs/Protocols/SwipeCollectionViewCellDelegate.html
public protocol SwipeCollectionViewCellDelegate: class
The SwipeCollectionViewCellDelegate protocol is adopted by an object that manages the display of action buttons when the item is swiped.
`
collectionView(_:editActionsForItemAt:for:)
`
Asks the delegate for the actions to display in response to a swipe in the specified item.
Swift
func collectionView(_ collectionView: UICollectionView, editActionsForItemAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]?
| collectionView |
The collection view object which owns the item requesting this information.
|
| indexPath |
The index path of the item.
|
| orientation |
The side of the item requesting this information.
|
An array of SwipeAction objects representing the actions for the item. Each action you provide is used to create a button that the user can tap. Returning nil will prevent swiping for the supplied orientation.
`
collectionView(_:editActionsOptionsForItemAt:for:)
` Default implementation
Asks the delegate for the display options to be used while presenting the action buttons.
Note
If not implemented, a default SwipeOptions instance is used.
Swift
func collectionView(_ collectionView: UICollectionView, editActionsOptionsForItemAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeOptions
| collectionView |
The collection view object which owns the item requesting this information.
|
| indexPath |
The index path of the item.
|
| orientation |
The side of the item requesting this information.
|
A SwipeOptions instance which configures the behavior of the action buttons.
`
collectionView(_:willBeginEditingItemAt:for:)
` Default implementation
Tells the delegate that the collection view is about to go into editing mode.
Swift
func collectionView(_ collectionView: UICollectionView, willBeginEditingItemAt indexPath: IndexPath, for orientation: SwipeActionsOrientation)
| collectionView |
The collection view object providing this information.
|
| indexPath |
The index path of the item.
|
| orientation |
The side of the item.
|
`
collectionView(_:didEndEditingItemAt:for:)
` Default implementation
Tells the delegate that the collection view has left editing mode.
Swift
func collectionView(_ collectionView: UICollectionView, didEndEditingItemAt indexPath: IndexPath?, for orientation: SwipeActionsOrientation)
| collectionView |
The collection view object providing this information.
|
| indexPath |
The index path of the item.
|
| orientation |
The side of the item.
|
`
visibleRect(for:)
` Default implementation
Asks the delegate for visibile rectangle of the collection view, which is used to ensure swipe actions are vertically centered within the visible portion of the item.
Note
The returned rectange should be in the collection view’s own coordinate system. Returning nil will result in no vertical offset to be be calculated.
Swift
func visibleRect(for collectionView: UICollectionView) -> CGRect?
| collectionView |
The collection view object providing this information.
|
The visible rectangle of the collection view.
© 2018 Mohammad Kurabi. All rights reserved. (Last updated: 2018-05-26)
Generated by jazzy ♪♫ v0.8.4, a Realm project.