if(nil == _library)async
_library = [[ALAssetsLibrary alloc] init];spa
__weak __typeof__(self) weakSelf = self;get
[_library writeImageToSavedPhotosAlbum:[savedImage CGImage] orientation:(ALAssetOrientation)[savedImage imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error){it
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{io
[weakSelf.library assetForURL:assetURL resultBlock:^(ALAsset *asset){//這裏的asset即是咱們所須要的圖像對應的ALAsset了queue
dispatch_async(dispatch_get_main_queue(),^{im
});error
}failureBlock:nil];di
});sse
}];