Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset with first album when there're no album after user granted some of photos #330

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix request photo auth method for iOS 14
MarkRunWu committed Mar 31, 2021
commit 25833a5f40f8c4aa83db93600ff987974f3abdc5
23 changes: 17 additions & 6 deletions Sources/Controller/ImagePickerController+Closure.swift
Original file line number Diff line number Diff line change
@@ -54,12 +54,23 @@ import Photos
}

private func authorize(_ authorized: @escaping () -> Void) {
PHPhotoLibrary.requestAuthorization { (status) in
switch status {
case .authorized:
DispatchQueue.main.async(execute: authorized)
default:
break
if #available(iOS 14, *) {
PHPhotoLibrary.requestAuthorization(for: .readWrite) { (status) in
switch status {
case .authorized:
DispatchQueue.main.async(execute: authorized)
default:
break
}
}
} else {
PHPhotoLibrary.requestAuthorization { (status) in
switch status {
case .authorized:
DispatchQueue.main.async(execute: authorized)
default:
break
}
}
}
}