Attachments Controller

  • The FUIAttachmentsViewController manages the presentation of a collection of attachment thumbnails, and previews of specific files.

    Configuration

    Developers should implement the FUIAttachmentsViewControllerDataSource and FUIAttachmentsViewControllerDelegate, 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 FUIAttachmentAction options. Attachment actions are typically used for acquiring (adding) attachments. Default FUIAttachmentAction implementations are provided, for obtaining data from the camera, or photo albums. Developers should add FUIAttachmentAction instances to the controller, using addAttachmentAction(action:).

    Presenting Attachment Previews

    The FUIAttachmentsViewController uses a native QLPreviewController to present file previews, when the user taps on an attachment icon. The QLPreviewController requires a valid file URL, and will request the URL for a selected attachment, in the FUIAttachmentsViewControllerDataSource urlForAttachmentAtIndex: method. If the developer returns nil, or, if the QLPreviewController cannot handle the URL provided, then the FUIAttachmentsViewControllerDelegate couldNotPresentAttachmentAtIndex: 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

    fdlFUIAttachmentsViewController
    fdlFUIAttachmentsViewController_alertActionTitle
    
    See more

    Declaration

    Swift

    open class FUIAttachmentsViewController : UIViewController, QLPreviewControllerDataSource, QLPreviewControllerDelegate
  • An object that adopts the FUIAttachmentsViewControllerDataSource protocol is responsible for providing the attachment URLs and icons for the FUIAttachmentsViewController.

    See more

    Declaration

    Swift

    public protocol FUIAttachmentsViewControllerDataSource : AnyObject
  • A delegate protocol for FUIAttachmentsViewController.

    See more

    Declaration

    Swift

    public protocol FUIAttachmentsViewControllerDelegate : AnyObject
  • The attachment action protocol.

    See more

    Declaration

    Swift

    public protocol FUIAttachmentAction
  • This class is an implementation of FUIAttachmentAction to allow the user to use the camera to take a photo as an attachment in FUIAttachmentsFormView.

    This action requires camera usage permission from the user. If isSavedToCameraRoll property is true, the Photo Library usage permission is also required.

    See more

    Declaration

    Swift

    open class FUITakePhotoAttachmentAction : FUIAttachmentAction
  • The delegate protocol for FUITakePhotoAttachmentAction.

    See more

    Declaration

    Swift

    public protocol FUITakePhotoAttachmentActionDelegate : AnyObject