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) -> IntParameters
attachmentsViewControllerthe 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
nilwill fallback to the default icon.Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, iconForAttachmentAtIndex index: Int) -> (image: UIImage, contentMode: UIViewContentMode)?Parameters
attachmentsViewControllerthe calling FUIAttachmentsViewController instance
indexthe item index of the attachment
Return Value
a thumbnail icon image for the attachment, and the
UIViewContentModewhich should be used in its presentation -
Gets the file URL of the attachment resource. Returning
nilwill cause theFUIAttachmentsViewControllerDelegatecouldNotPresentAttachmentAtIndex: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
attachmentsViewControllerthe calling AttachmentFormView instance
indexthe 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
nilwill fallback to the default icon.Declaration
Swift
func attachmentsViewController(_ attachmentsViewController: FUIAttachmentsViewController, titleForAttachmentAtIndex index: Int) -> String?Parameters
attachmentsViewControllerthe calling FUIAttachmentsViewController instance
indexthe 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
attachmentsViewControllerthe calling FUIAttachmentsViewController instance
indexthe 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
attachmentsViewControllerthe calling FUIAttachmentsViewController instance.
indexthe item index of the attachment.
Return Value
a footnote for the attachment.