Post

Replies

Boosts

Views

Activity

Reply to PHAssetCreationRequest fails with cocoa error -1
For those who might come across this thread in the future, here's a code example in Swift demonstrating what @sseb974 was referring to above: PHPhotoLibrary.shared().performChanges {       let creationRequest = PHAssetCreationRequest.forAsset()       creationRequest.addResource(with: .photo, data: myOriginalImageData, options: nil)       let editingOutput = PHContentEditingOutput(placeholderForCreatedAsset: creationRequest.placeholderForCreatedAsset!)       try! myRenderedJpegData.write(to: editingOutput.renderedContentURL, options: .atomic)       creationRequest.contentEditingOutput = editingOutput     } completionHandler: { (success: Bool, error: Error?) in     }
May ’21