FUITakePhotoAttachmentActionDelegate
public protocol FUITakePhotoAttachmentActionDelegate : AnyObject
The delegate protocol for FUITakePhotoAttachmentAction.
-
This function is invoked when a photo is taken from the camera and the
isSavedToCameraRollproperty of theFUITakePhotoAttachmentActionis true.** Note: This function will not be invoked for iOS 14 when “Photos” setting is “Selected Photos”, since the new
PHAssetis not available for newly taken photos in that setting.Important
URLs with the
assets-libraryscheme refer to assets in the user’s Photo Library. These assets may be deleted by the user, or cleaned up by the library. Use thePHAssetAPIs 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
actionThe
FUITakePhotoAttachmentActionobject.urlThe
assets-libraryURL of the captured photo.assetThe
PHAssetof the photo. -
This function is invoked when a photo is taken and the
isSavedToCameraRollproperty of theFUITakePhotoAttachmentActionis false.** Note: This function is always invoked for iOS 14 when “Photos” setting is “Selected Photos”, since the new
PHAssetis not available for newly taken photos in that setting.The developer is responsible to save the photo image and provide a
URLto the saved image so that the image can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleris using the nativeQLPreviewControllerto 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 thatQLPreviewControllercan preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakePhoto image: UIImage)Parameters
actionThe
FUITakePhotoAttachmentActionobject.imageThe
UIImagefor the photo. -
This function is invoked when a video is taken and the
isSavedToCameraRollproperty of theFUITakePhotoAttachmentActionis false.The developer is responsible to save the video and provide a
URLto the saved video so that the video can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleris using the nativeQLPreviewControllerto preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakeVideo url: URL)Parameters
actionThe
FUITakePhotoAttachmentActionobject.urlThe
URLfor the video.