I have this code for retrieving an image and adding it to an array:
//Set the size of the video to 1280x720
CGSize targetSize = CGSizeMake(1280, 720);
PHImageRequestOptions *options = [[PHImageRequestOptions alloc]init];
options.synchronous = YES;
PHImageManager *manager = [[PHImageManager alloc]init];
for (PHAsset *asset in self.assetsToVideofy){
[manager requestImageForAsset:asset
targetSize:targetSize
contentMode:PHImageContentModeAspectFit
options:options
resultHandler:^(UIImage *result, NSDictionary *info) {
if (result) {
[self.photosToVideofy addObject:result];
}
}];
The problem is that the images only get added as thumbnails. How can I make sure that the image is loaded at the targetSize and then added to the array?
Thanks