カメラロールに画像を保存(iOS)

ALAssetsLibrary の writeImageToSavedPhotosAlbum メソッドを使います。

ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
UIImage* img = self.imageView.image;
[library writeImageToSavedPhotosAlbum:img.CGImage orientation:ALAssetOrientationUp completionBlock:^(NSURL *assetURL, NSError *error) {
    if (error) {
        //エラー処理
    }
}];

 

タグ:

コメントを残す

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください