Commit 464355a9 authored by David黄金龙's avatar David黄金龙

代码同步

parent 5b880bfd
...@@ -156,12 +156,14 @@ extension YHInvatationShareViewController { ...@@ -156,12 +156,14 @@ 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 {
YHHUD.flash(message: "保存失败,请检查系统权限") DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
} }
} }
} }
......
...@@ -191,11 +191,13 @@ class YHConsultantQRCodeView: UIView { ...@@ -191,11 +191,13 @@ 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 {
YHHUD.flash(message: "保存失败,请检查系统权限") DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
} }
} }
} }
......
...@@ -101,9 +101,14 @@ private extension YHVisaPayTypeCell { ...@@ -101,9 +101,14 @@ private extension YHVisaPayTypeCell {
PHPhotoLibrary.requestAuthorization { status in PHPhotoLibrary.requestAuthorization { status in
if status == .authorized { if status == .authorized {
// 保存UIImage对象到相册 // 保存UIImage对象到相册
UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(_:didFinishSavingWithError:contextInfo:)), nil) DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(_:didFinishSavingWithError:contextInfo:)), nil)
}
} else { } else {
YHHUD.flash(message: "保存失败,请检查系统权限") DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
} }
} }
} }
......
...@@ -233,11 +233,13 @@ extension YHFileListViewController { ...@@ -233,11 +233,13 @@ 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 {
YHHUD.flash(message: "保存失败,请检查系统权限") DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
} }
} }
} }
......
...@@ -489,11 +489,13 @@ extension YHMyFileListViewController { ...@@ -489,11 +489,13 @@ 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 {
YHHUD.flash(message: "保存失败,请检查系统权限") DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
} }
} }
} }
......
...@@ -147,12 +147,14 @@ extension YHResignGuidelinesExampleShareViewController { ...@@ -147,12 +147,14 @@ 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 {
YHHUD.flash(message: "保存失败,请检查系统权限") DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
} }
} }
} }
......
...@@ -254,12 +254,14 @@ private extension YHLongtapPictureSheetView { ...@@ -254,12 +254,14 @@ 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 {
YHHUD.flash(message: "保存失败,请检查系统权限") DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
} }
} }
} }
......
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