setUploadJobExtensionEnabled(_:)

setUploadJobExtensionEnabled(_:)

setUploadJobExtensionEnabled(_:) Instance Method of PHPhotoLibrary Enables or disables the background asset resource upload job feature.

func setUploadJobExtensionEnabled(_ enable: Bool) throws

Parameters

enable

true allows calls to the extension’s host application; you can fulfill that protocol to create PHAssetResourceUploadJob objects. false stops calls to the extension’s host application.

Discussion

You must call this function before you create PHAssetResourceUploadJob in the extension’s host application.

To enable background uploads, you must have both full library access and register the extension with the extension point: “com.apple.photos.background-upload”.