add access for selected photos permission
This commit is contained in:
parent
b54de30d5c
commit
113a931645
|
@ -92,6 +92,19 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
|
|||
selectionPanGesture.delegate = self
|
||||
self.selectionPanGesture = selectionPanGesture
|
||||
collectionView.addGestureRecognizer(selectionPanGesture)
|
||||
|
||||
if #available(iOS 14, *) {
|
||||
if PHPhotoLibrary.authorizationStatus(for: .readWrite) == .limited {
|
||||
let addSeletedPhotoButton = UIBarButtonItem.init(barButtonSystemItem: .add, target: self, action: #selector(addSelectedPhoto))
|
||||
self.navigationItem.rightBarButtonItem = addSeletedPhotoButton
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc func addSelectedPhoto(_ sender: Any) {
|
||||
if #available(iOS 14, *) {
|
||||
PHPhotoLibrary.shared().presentLimitedLibraryPicker(from: self)
|
||||
}
|
||||
}
|
||||
|
||||
var selectionPanGesture: UIPanGestureRecognizer?
|
||||
|
|
Loading…
Reference in New Issue