My photo extension app has access to both Camera and Photos. All is ok, but when pressing Done, it can not save image.
Code of standard completion handl
Even though the header implies that adjustmentData can be nil, the documentation states:
If you write new asset content to the URL specified by the renderedContentURL property, you must also provide a new, distinct PHAdjustmentData object describing your edit. Passing a preexisting adjustment data object (that describes an earlier edit) results in undefined behavior.
So do something like this before calling the completion handler:
output.adjustmentData = [[PHAdjustmentData alloc] initWithFormatIdentifier:@"com.whatever.app" formatVersion:@"1.0" data:[NSData data]];
As of iOS 10, the adjustment data must have at least one byte. This is a breaking change from iOS 9, where the adjustment data can be nil. I've tested this on both iOS 9 and iOS 10 to confirm.
Additional documentation: https://developer.apple.com/reference/photos/phcontenteditingoutput/1518684-adjustmentdata
PHContentEditingOutput* output = [[PHContentEditingOutput alloc] initWithContentEditingInput:self.input];
NSMutableData* adjustmentData = [NSMutableData data];
uint8_t byte = 1;
[adjustmentData appendBytes:&byte length:1];
output.adjustmentData = [[PHAdjustmentData alloc] initWithFormatIdentifier:@"com.yourcompany.yourapp" formatVersion:@"1.0f" data:adjustmentData];