Attachments Controller
-
The
FUIAttachmentsViewControllermanages the presentation of a collection of attachment thumbnails, and previews of specific files.Configuration
Developers should implement the
FUIAttachmentsViewControllerDataSourceandFUIAttachmentsViewControllerDelegate, to supply content to the controller, and handle events.Attachment Actions
The controller also supports presentation of an “Add Attachment” action sheet, which displays a list of
FUIAttachmentActionoptions. Attachment actions are typically used for acquiring (adding) attachments. DefaultFUIAttachmentActionimplementations are provided, for obtaining data from the camera, or photo albums. Developers should addFUIAttachmentActioninstances to the controller, usingaddAttachmentAction(action:).Presenting Attachment Previews
The
FUIAttachmentsViewControlleruses a nativeQLPreviewControllerto present file previews, when the user taps on an attachment icon. TheQLPreviewControllerrequires a valid file URL, and will request the URL for a selected attachment, in theFUIAttachmentsViewControllerDataSourceurlForAttachmentAtIndex:method. If the developer returnsnil, or, if theQLPreviewControllercannot handle the URL provided, then theFUIAttachmentsViewControllerDelegatecouldNotPresentAttachmentAtIndex:method will be invoked. The developer should handle the presentation for these cases, using a custom view controller, or other presentation framework.Theming
Supported style classes
See morefdlFUIAttachmentsViewController fdlFUIAttachmentsViewController_alertActionTitleDeclaration
Swift
@MainActor open class FUIAttachmentsViewController : UIViewController, QLPreviewControllerDataSource, QLPreviewControllerDelegate -
An object that adopts the
See moreFUIAttachmentsViewControllerDataSourceprotocol is responsible for providing the attachment URLs and icons for theFUIAttachmentsViewController.Declaration
Swift
public protocol FUIAttachmentsViewControllerDataSource : AnyObject -
A delegate protocol for
See moreFUIAttachmentsViewController.Declaration
Swift
public protocol FUIAttachmentsViewControllerDelegate : AnyObject -
The attachment action protocol.
See moreDeclaration
Swift
public protocol FUIAttachmentAction -
This class is an implementation of
FUIAttachmentActionto allow the user to use the camera to take a photo as an attachment inFUIAttachmentsFormView.This action requires camera usage permission from the user. If
See moreisSavedToCameraRollproperty istrue, the Photo Library usage permission is also required.Declaration
Swift
open class FUITakePhotoAttachmentAction : FUIAttachmentAction -
The delegate protocol for
See moreFUITakePhotoAttachmentAction.Declaration
Swift
public protocol FUITakePhotoAttachmentActionDelegate : AnyObject