I have an app which combines multiple videos, the initial list of PHAssets are displayed and selected to form an array of PHAssets. Now on the screen which creates the video I need to loop through and fetch the AVAsset from the PHAsset.
The issue I am trying to understand is how to track the progress and determine the end of all the asynchronous fetches. When the loop is complete I can move onto actually combining all the videos.
for (PHAsset * object in self.arraySelectedAssets) {
[[PHImageManager defaultManager] requestAVAssetForVideo:object options:nil resultHandler:^(AVAsset *avAsset, AVAudioMix *audioMix, NSDictionary *info) {
NSLog(@"Fetched");
//here asset in nil! IOS 10 only, IOS 11 works fine
AVURLAsset * assetUrl = (AVURLAsset*)avAsset;
}];
}