The photo extension application has access to both cameras and photos. Everything is in order, but when you click Finish, it cannot save the image.
Standard completion handler code:
- (void)finishContentEditingWithCompletionHandler:(void (^)(PHContentEditingOutput *))completionHandler { // Update UI to reflect that editing has finished and output is being rendered. // Render and provide output on a background queue. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ PHContentEditingOutput *output = [[PHContentEditingOutput alloc] initWithContentEditingInput:self.input]; NSError* error = nil; NSData *renderedJPEGData = UIImageJPEGRepresentation(filtered_ui_image, 1.0); assert(renderedJPEGData != nil); //BOOL written_well = [renderedJPEGData writeToURL:output.renderedContentURL atomically:YES]; BOOL written_well = [renderedJPEGData writeToURL:output.renderedContentURL options:NSDataWritingAtomic error:&error]; assert(written_well); // Call completion handler to commit edit to Photos. completionHandler(output); }); }
renderedJPEGData not nil ,
error - nil , so the function [NSData writeToURL] was successful,
written_well is YES ,
when debugging in turn, a warning appears after block completion: 
output.renderedContentURL /private/var/mobile/Containers/Data/PluginKitPlugin/509C1A04-D414-4DB7-B1E6-83C47FC88BC9/tmp/blah_blah_name.JPG
So, I have permissions, debug does not show errors, what can I try to determine the cause of the problem?
source share