CollectionViewPreviewControllerDelegate

public protocol CollectionViewPreviewControllerDelegate : AnyObject

a CollectionViewPreviewControllerDelegate is responsible for providing data to a CollectionViewPreviewController.

  • Asks the delegate for a cell to use to preview the item at indexPath

    CollectionViewPreviewCell provides a basic implementation of transitions and can be subclasses for custom transitions from and back to the source.

    Declaration

    Swift

    func collectionViewPreviewController(_ controller: CollectionViewPreviewController, cellForItemAt indexPath: IndexPath) -> CollectionViewCell

    Parameters

    controller

    The controller requesting the cell

    indexPath

    The indexpath of the item to represent

    Return Value

    A collection view cell

  • Asks the delegate if the item at the specified index path should be included in the preview.

    If false, under the default usage the preview collection view will not attempt to render a cell for the item. You can safely assume that collectionViewPreviewController(_:cellForItemAt:) will not be called for these items.

    Declaration

    Swift

    func collectionViewPreviewController(_ controller: CollectionViewPreviewController, canPreviewItemAt indexPath: IndexPath) -> Bool

    Parameters

    controller

    The controller requesting the information

    indexPath

    The index path of the item

    Return Value

    True if the item can be previewed, false if not.

  • Notifies the delegate that the preview controller will dismiss

    Declaration

    Swift

    func collectionViewPreviewControllerWillDismiss(_ controller: CollectionViewPreviewController)

    Parameters

    controller