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
attachmentsViewController
The calling
FUIAttachmentsViewController
.index
The 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
nil
toFUIAttachmentsViewControllerDataSource
urlForAttachmentAtIndex:
method, or if the file at the URL provided cannot be presented by aUIDocumentInteractionController
.Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, couldNotPresentAttachmentAtIndex index: Int)
Parameters
attachmentsViewController
The calling
FUIAttachmentsViewController
.index
The 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
QLPreviewController
to display attachments.Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, didSelectAtIndex index: Int) -> Bool
Parameters
attachmentsViewController
The calling
FUIAttachmentsViewController
.index
The 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:)
inFUIAttachmentsViewController
Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, willShowAttachment cell: UICollectionViewCell, cellForItemAt index: Int) -> UICollectionViewCell?
Parameters
attachmentsViewController
The calling
FUIAttachmentsViewController
.cell
The default
UICollectionViewCell
generated by theFUIAttachmentsViewController
.index
The index of the attachment, for which presentation was attempted.
Return Value
A custom
UICollectionViewCell
to be displayed for the attachment. Or,nil
if the default generated cell is to be used.