0
In iOS8 und später erhalte ich Bilder in diesem Code:Wie bekomme ich Bild Typ In PHAsset (PNG oder JPG)?
PHFetchOptions *option = [[PHFetchOptions alloc] init];
option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO]];
PHFetchResult *result = [PHAsset fetchAssetsInAssetCollection:_collection options:option];
[result enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (((PHAsset *)obj).mediaType == PHAssetMediaTypeImage) {
PHCachingImageManager *imageManager = [[PHCachingImageManager alloc] init];
PHAsset *asset = obj;
PHImageRequestOptions * options = [[PHImageRequestOptions alloc] init];
options.networkAccessAllowed = YES;
options.synchronous = YES;
[imageManager requestImageDataForAsset:asset options:options resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
/*******/
/* Now I get image type in here with imageDate*/
/* I just want JPG type Image*/
}];
}
}];
Aber in diesem Code, ich brauche viel Zeit, also wie kann ich Bild-Art mit PHAsset bekommen und nicht verwenden requestImageData