Attachments Controller
-
The
FUIAttachmentsViewController
manages the presentation of a collection of attachment thumbnails, and previews of specific files.Configuration
Developers should implement the
FUIAttachmentsViewControllerDataSource
andFUIAttachmentsViewControllerDelegate
, 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 ofFUIAttachmentAction
options. Attachment actions are typically used for acquiring (adding) attachments. DefaultFUIAttachmentAction
implementations are provided, for obtaining data from the camera, or photo albums. Developers should addFUIAttachmentAction
instances to the controller, usingaddAttachmentAction(action:)
.Presenting Attachment Previews
The
FUIAttachmentsViewController
uses a nativeQLPreviewController
to present file previews, when the user taps on an attachment icon. TheQLPreviewController
requires a valid file URL, and will request the URL for a selected attachment, in theFUIAttachmentsViewControllerDataSource
urlForAttachmentAtIndex:
method. If the developer returnsnil
, or, if theQLPreviewController
cannot handle the URL provided, then theFUIAttachmentsViewControllerDelegate
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
See morefdlFUIAttachmentsViewController fdlFUIAttachmentsViewController_alertActionTitle
Declaration
Swift
open class FUIAttachmentsViewController : UIViewController, QLPreviewControllerDataSource, QLPreviewControllerDelegate
-
An object that adopts the
See moreFUIAttachmentsViewControllerDataSource
protocol 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
FUIAttachmentAction
to allow user to choose a photo from photo library as an attachment inFUIAttachmentsFormView
.This action requires photo library usage permission from user.
See moreDeclaration
Swift
public class FUIAddPhotoAttachmentAction : FUIAttachmentAction
-
The delegate protocol for
See moreFUIAddPhotoAttachmentAction
.Declaration
Swift
public protocol FUIAddPhotoAttachmentActionDelegate : AnyObject
-
This class is an implementation of
FUIAttachmentAction
to allow user to use camera to take a photo as an attachment inFUIAttachmentsFormView
.This action requires camera usage permission from user. If
See moreisSavedToCameraRoll
property istrue
, the photo library usage permission is also required.Declaration
Swift
public class FUITakePhotoAttachmentAction : FUIAttachmentAction
-
The delegate protocol for
See moreFUITakePhotoAttachmentAction
.Declaration
Swift
public protocol FUITakePhotoAttachmentActionDelegate : AnyObject