FUITakePhotoAttachmentActionDelegate
public protocol FUITakePhotoAttachmentActionDelegate : AnyObject
The delegate protocol for FUITakePhotoAttachmentAction
.
-
This function is invoked when a photo is taken from the camera and the
isSavedToCameraRoll
property of theFUITakePhotoAttachmentAction
is true.** Note: This function will not be invoked for iOS 14 when “Photos” setting is “Selected Photos”, since the new
PHAsset
is not available for newly taken photos in that setting.Important
URLs with the
assets-library
scheme refer to assets in the user’s Photo Library. These assets may be deleted by the user, or cleaned up by the library. Use thePHAsset
APIs to access the image data directly and create a persistent copy of the file if one is needed.Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakePhoto asset: PHAsset, at url: URL)
Parameters
action
The
FUITakePhotoAttachmentAction
object.url
The
assets-library
URL of the captured photo.asset
The
PHAsset
of the photo. -
This function is invoked when a photo is taken and the
isSavedToCameraRoll
property of theFUITakePhotoAttachmentAction
is false.** Note: This function is always invoked for iOS 14 when “Photos” setting is “Selected Photos”, since the new
PHAsset
is not available for newly taken photos in that setting.The developer is responsible to save the photo image and provide a
URL
to the saved image so that the image can be accessed in theFUIAttachmentsFormViewDataSource
implementation. Internally,FUIAttachmentsViewController
is using the nativeQLPreviewController
to preview the attachment. Therefore, it is recommended that the image is saved as JPEG or PNG and the URL has an extension of “JPG” or “PNG”, respectively, so thatQLPreviewController
can preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakePhoto image: UIImage)
Parameters
action
The
FUITakePhotoAttachmentAction
object.image
The
UIImage
for the photo. -
This function is invoked when a video is taken and the
isSavedToCameraRoll
property of theFUITakePhotoAttachmentAction
is false.The developer is responsible to save the video and provide a
URL
to the saved video so that the video can be accessed in theFUIAttachmentsFormViewDataSource
implementation. Internally,FUIAttachmentsViewController
is using the nativeQLPreviewController
to preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakeVideo url: URL)
Parameters
action
The
FUITakePhotoAttachmentAction
object.url
The
URL
for the video.