FUIAttachmentsViewControllerDelegate
public protocol FUIAttachmentsViewControllerDelegate : AnyObject
A delegate protocol for FUIAttachmentsViewController.
-
To notify when user tapped delete to an attachment.
Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, didPressDeleteAtIndex index: Int)Parameters
attachmentsViewControllerThe calling
FUIAttachmentsViewController.indexThe location of the attachment to be deleted.
-
This function is invoked, if the controller failed to obtain a valid file URL for an attachment which should be presented. This may occur when the developer returns
niltoFUIAttachmentsViewControllerDataSourceurlForAttachmentAtIndex:method, or if the file at the URL provided cannot be presented by aUIDocumentInteractionController.Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, couldNotPresentAttachmentAtIndex index: Int)Parameters
attachmentsViewControllerThe calling
FUIAttachmentsViewController.indexThe index of the attachment, for which presentation was attempted.
-
This function is invoked when user selects an attachment.
The default implementation is to return false. That is using the built-in
QLPreviewControllerto display attachments.Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, didSelectAtIndex index: Int) -> BoolParameters
attachmentsViewControllerThe calling
FUIAttachmentsViewController.indexThe index of the attachment, for which presentation was attempted.
Return Value
True if the delegate implementation is handling the display of selected attachment.
-
This function is invoked when the attachment icon cell is to be displayed.
This function allows the developers to customize the attachment icon cell.
See also
Functions
register(_:, forCellWithReuseIdentifier:)anddequeueReusableCell(withReuseIdentifier:, forAttachment:)inFUIAttachmentsViewControllerDeclaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, willShowAttachment cell: UICollectionViewCell, cellForItemAt index: Int) -> UICollectionViewCell?Parameters
attachmentsViewControllerThe calling
FUIAttachmentsViewController.cellThe default
UICollectionViewCellgenerated by theFUIAttachmentsViewController.indexThe index of the attachment, for which presentation was attempted.
Return Value
A custom
UICollectionViewCellto be displayed for the attachment. Or,nilif the default generated cell is to be used.