FUIAttachmentsViewControllerDataSource

public protocol FUIAttachmentsViewControllerDataSource : AnyObject

An object that adopts the FUIAttachmentsViewControllerDataSource protocol is responsible for providing the attachment URLs and icons for the FUIAttachmentsViewController.

  • Gets the number of attachments to display in the FUIAttachmentsViewController’s collection

    Declaration

    Swift

    func numberOfAttachments(in attachmentsViewController: FUIAttachmentsViewController) -> Int

    Parameters

    attachmentsViewController

    the calling FUIAttachmentsViewController instance

    Return Value

    number of attachments to display in calling FUIAttachmentsViewController’s collection

  • Gets the thumbnail image for the attachment at the specified index. Will override the default icon. Returning nil will fallback to the default icon.

    Declaration

    Swift

    func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, iconForAttachmentAtIndex index: Int) -> (image: UIImage, contentMode: UIViewContentMode)?

    Parameters

    attachmentsViewController

    the calling FUIAttachmentsViewController instance

    index

    the item index of the attachment

    Return Value

    a thumbnail icon image for the attachment, and the UIViewContentMode which should be used in its presentation

  • Gets the file URL of the attachment resource. Returning nil will cause the FUIAttachmentsViewControllerDelegate couldNotPresentAttachmentAtIndex: method to be invoked, when the user taps on the attachment resource in the view.

    Declaration

    Swift

    func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, urlForAttachmentAtIndex index: Int) -> URL?

    Parameters

    attachmentsViewController

    the calling AttachmentFormView instance

    index

    the item index of the attachment (single-vector)

    Return Value

    the optional file URL of the attachment resource

  • Gets the thumbnail image for the attachment at the specified index. Will override the default icon. Returning nil will fallback to the default icon.

    Declaration

    Swift

    func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, titleForAttachmentAtIndex index: Int) -> String?

    Parameters

    attachmentsViewController

    the calling FUIAttachmentsViewController instance

    index

    the item index of the attachment

    Return Value

    a title for the attachment

  • Gets the attachment subtitle.

    Declaration

    Swift

    func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, subtitleForAttachmentAtIndex index: Int) -> String?

    Parameters

    attachmentsViewController

    the calling FUIAttachmentsViewController instance

    index

    the item index of the attachment

    Return Value

    a subtitle for the attachment

  • Gets the attachment subtitle.

    Declaration

    Swift

    func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, footnoteForAttachmentAtIndex index: Int) -> String?

    Parameters

    attachmentsViewController

    the calling FUIAttachmentsViewController instance.

    index

    the item index of the attachment.

    Return Value

    a footnote for the attachment.