FUITakePhotoAttachmentActionDelegate
public protocol FUITakePhotoAttachmentActionDelegate : AnyObject
The delegate protocol for FUITakePhotoAttachmentAction
.
-
This function is invoked when a photo is taken from camera on iOS 11 devices when the
isSavedToCameraRoll
property of theFUITakePhotoAttachmentAction
is false.Note that
PHAsset
‘sfetchAssets(withALAssetURLs:options:)
API is deprecated in iOS 11.SAPFiori
framework providesPHAsset
directly to the delegate to access the photo’sPHAsset
.Important
URL’s with scheme:
assets-library
refer to assets in the user’s Photos library. These assets may be deleted by the User, or cleaned-up by the library. Use thePHAssets
API’s to access the image data directly, and create a persistent copy of the file, if one is needed.Declaration
Swift
@available(iOS 11.0, *) func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakePhoto asset: PHAsset, at url: URL)
Parameters
action
The
FUITakePhotoAttachmentAction
object.url
The
assets-library
URL of the photo captured.asset
The
PHAsset
of the photo. -
takePhotoAttachmentAction(_:didTakePhoto:)
Default implementationThis function is invoked when a phto is taken and the
isSavedToCameraRoll
property of theFUITakePhotoAttachmentAction
is false.Developer is responsible to save the photo image and provide a
URL
to the saved image so that the image could be accessed inFUIAttachmentsFormViewDataSource
implementation. Internally,FUIAttachmentsViewController
is using nativeQLPreviewController
to preview the attachment. Therefore, it is recommended that the image is saved as JPEG or PNG and the URL has an extension ofJPG
orPNG
, respectively, so thatQLPreviewController
can preview the attachment.Default Implementation
Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakePhoto image: UIImage)
Parameters
action
The
FUITakePhotoAttachmentAction
object.image
The
UIImage
for the photo taken. -
takePhotoAttachmentAction(_:didTakeVideo:)
Default implementationThis function is invoked when a video is taken and the
isSavedToCameraRoll
property of theFUITakePhotoAttachmentAction
is false.Developer is responsible to save the video and provide a
URL
to the saved video so that the video could be accessed inFUIAttachmentsFormViewDataSource
implementation. Internally,FUIAttachmentsViewController
is using nativeQLPreviewController
to preview the attachment.Default Implementation
Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakeVideo url: URL)
Parameters
action
The
FUITakePhotoAttachmentAction
object.url
The
URL
for the video taken.
-
takePhotoAttachmentAction(_:didTakePhotoAt:)
Extension methodUndocumented
Declaration
Swift
func takePhotoAttachmentAction(_ action: FUITakePhotoAttachmentAction, didTakePhotoAt url: URL)