Commit f6d9e324 authored by Alex朱枝文's avatar Alex朱枝文

保存图片放异步主线程处理

parent 6be8179e
...@@ -156,8 +156,8 @@ extension YHInvatationShareViewController { ...@@ -156,8 +156,8 @@ extension YHInvatationShareViewController {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存图片到相册 // 保存图片到相册
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
DispatchQueue.main.async { DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
YHHUD.flash(message: "保存成功") YHHUD.flash(message: "保存成功")
} }
} else { } else {
......
...@@ -191,7 +191,7 @@ class YHConsultantQRCodeView: UIView { ...@@ -191,7 +191,7 @@ class YHConsultantQRCodeView: UIView {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存图片到相册 // 保存图片到相册
DispatchQueue.main.sync { DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(image:didFinishSavingWithError:contextInfo:)), nil) UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(image:didFinishSavingWithError:contextInfo:)), nil)
} }
} else { } else {
......
...@@ -233,7 +233,7 @@ extension YHFileListViewController { ...@@ -233,7 +233,7 @@ extension YHFileListViewController {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存图片到相册 // 保存图片到相册
DispatchQueue.main.sync { DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(image:didFinishSavingWithError:contextInfo:)), nil) UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(image:didFinishSavingWithError:contextInfo:)), nil)
} }
} else { } else {
......
...@@ -489,7 +489,7 @@ extension YHMyFileListViewController { ...@@ -489,7 +489,7 @@ extension YHMyFileListViewController {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存图片到相册 // 保存图片到相册
DispatchQueue.main.sync { DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(image:didFinishSavingWithError:contextInfo:)), nil) UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(image:didFinishSavingWithError:contextInfo:)), nil)
} }
} else { } else {
......
...@@ -147,8 +147,8 @@ extension YHResignGuidelinesExampleShareViewController { ...@@ -147,8 +147,8 @@ extension YHResignGuidelinesExampleShareViewController {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存图片到相册 // 保存图片到相册
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
DispatchQueue.main.async { DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
YHHUD.flash(message: "保存成功") YHHUD.flash(message: "保存成功")
} }
} else { } else {
......
...@@ -407,8 +407,8 @@ extension YHH5WebViewVC { ...@@ -407,8 +407,8 @@ extension YHH5WebViewVC {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存图片到相册 // 保存图片到相册
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
DispatchQueue.main.async { DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
YHHUD.flash(message: "保存成功") YHHUD.flash(message: "保存成功")
} }
} else { } else {
......
...@@ -254,8 +254,8 @@ private extension YHLongtapPictureSheetView { ...@@ -254,8 +254,8 @@ private extension YHLongtapPictureSheetView {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存图片到相册 // 保存图片到相册
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
DispatchQueue.main.async { DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
YHHUD.flash(message: "保存成功") YHHUD.flash(message: "保存成功")
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment