UIImageView の上に回転するアクティビティ ビューを表示し、画像の読み込みが完了して表示されたら、アクティビティ ビューを停止して非表示にしたいと考えています。画像は、資産ライブラリから取得した大きな写真です。
- (void)viewDidLoad
{
//set photo
UIImageView *Photo = _photo;
NSURL *url = [[NSURL alloc] initWithString:project.photo];
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
[library assetForURL:url resultBlock:^(ALAsset *asset) {
ALAssetRepresentation *rep = [asset defaultRepresentation];
CGImageRef iref = [rep fullResolutionImage];
if (iref) {
self.photo.image = [UIImage imageWithCGImage:[rep fullScreenImage] scale:[rep scale] orientation:0];
}
} failureBlock:^(NSError *error) {
NSLog(@"Couldn't load asset %@ => %@", error, [error localizedDescription]);
}];
[_ImageLoader stopAnimating];
}
ただし、アクティビティ ビューが常に回転しているため、これは機能しません。