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 for saving the photo image and providing a
URLto the saved image so that the image can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleruses the nativeQLPreviewControllerto preview the attachment. Save the image 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 for saving the video and providing a
URLto the saved video so that the video can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleruses the nativeQLPreviewControllerto preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakeVideo url: URL)Parameters
actionThe
FUITakePhotoAttachmentActionobject.urlThe
URLfor the video. -
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(_ attachmentsViewController: FUIAttachmentsViewController, action: FUITakePhotoAttachmentAction, didTakePhoto asset: PHAsset, at url: URL)Parameters
attachmentsViewControllerThe
FUIAttachmentsViewControllerthat this action was added to.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 for saving the photo image and providing a
URLto the saved image so that the image can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleruses the nativeQLPreviewControllerto preview the attachment. Save the image as JPEG or PNG, and the URL has an extension of “JPG” or “PNG”, respectively, so thatQLPreviewControllercan preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ attachmentsViewController: FUIAttachmentsViewController, action: FUITakePhotoAttachmentAction, didTakePhoto image: UIImage)Parameters
attachmentsViewControllerThe
FUIAttachmentsViewControllerthat this action was added to.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 for saving the video and providing a
URLto the saved video so that the video can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleruses the nativeQLPreviewControllerto preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ attachmentsViewController: FUIAttachmentsViewController, action: FUITakePhotoAttachmentAction, didTakeVideo url: URL)Parameters
attachmentsViewControllerThe
FUIAttachmentsViewControllerthat this action was added to.actionThe
FUITakePhotoAttachmentActionobject.urlThe
URLfor the video.
-
This function is invoked when a photo is taken from the camera with location capture enabled. The
isSavedToCameraRollproperty of theFUITakePhotoAttachmentActionmust be true.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(_ attachmentsViewController: FUIAttachmentsViewController, action: FUITakePhotoAttachmentAction, didTakePhoto asset: PHAsset, at url: URL, location: CLLocation?)Parameters
attachmentsViewControllerThe
FUIAttachmentsViewControllerthat this action was added to.actionThe
FUITakePhotoAttachmentActionobject.assetThe
PHAssetof the photo.urlThe
assets-libraryURL of the captured photo.locationThe device location at the time of capture, or nil if unavailable.
-
This function is invoked when a photo is taken with location capture enabled. The
isSavedToCameraRollproperty of theFUITakePhotoAttachmentActionmust be false.The developer is responsible for saving the photo image and providing a
URLto the saved image so that the image can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleruses the nativeQLPreviewControllerto preview the attachment. Save the image as JPEG or PNG, and the URL has an extension of “JPG” or “PNG”, respectively, so thatQLPreviewControllercan preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ attachmentsViewController: FUIAttachmentsViewController, action: FUITakePhotoAttachmentAction, didTakePhoto image: UIImage, location: CLLocation?)Parameters
attachmentsViewControllerThe
FUIAttachmentsViewControllerthat this action was added to.actionThe
FUITakePhotoAttachmentActionobject.imageThe
UIImagefor the photo.locationThe device location at the time of capture, or nil if unavailable.
-
This function is invoked when a video is taken with location capture enabled. The
isSavedToCameraRollproperty of theFUITakePhotoAttachmentActionmust be false.The developer is responsible for saving the video and providing a
URLto the saved video so that the video can be accessed in theFUIAttachmentsFormViewDataSourceimplementation. Internally,FUIAttachmentsViewControlleruses the nativeQLPreviewControllerto preview the attachment.Declaration
Swift
func takePhotoAttachmentAction(_ attachmentsViewController: FUIAttachmentsViewController, action: FUITakePhotoAttachmentAction, didTakeVideo url: URL, location: CLLocation?)Parameters
attachmentsViewControllerThe
FUIAttachmentsViewControllerthat this action was added to.actionThe
FUITakePhotoAttachmentActionobject.urlThe
URLfor the video.locationThe device location at the time of capture, or nil if unavailable.
-
This function is invoked immediately after the camera is dismissed and before any processing begins. Use this to show a loading indicator while the media is being processed (for example, during GPS location fetch).
Declaration
Swift
func takePhotoAttachmentActionDidStartProcessing(_ attachmentsViewController: FUIAttachmentsViewController, action: FUITakePhotoAttachmentAction)Parameters
attachmentsViewControllerThe
FUIAttachmentsViewControllerthat this action was added to.actionThe
FUITakePhotoAttachmentActionobject.