How to use PHPhotoLibrary like ALAssetsLibrary

后端 未结 1 897
闹比i
闹比i 2020-12-15 23:15

For iOS9, ALAssetsLibrary is deprecated. So how to change it as PHPPhotoLibrary instead of ALAssets?

if (RecordedSucc         


        
相关标签:
1条回答
  • 2020-12-16 00:00
    // Save to the album
       __block PHObjectPlaceholder *placeholder;
    
        [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
            PHAssetChangeRequest* createAssetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:outputFileURL];
            placeholder = [createAssetRequest placeholderForCreatedAsset];
    
        } completionHandler:^(BOOL success, NSError *error) {
            if (success)
            {
               NSLog(@"didFinishRecordingToOutputFileAtURL - success for ios9");
            }
            else
            {
                NSLog(@"%@", error);
            }
        }];
    
    0 讨论(0)
提交回复
热议问题