diff --git a/Session/Media Viewing & Editing/ImagePickerController.swift b/Session/Media Viewing & Editing/ImagePickerController.swift index 3500fdc99..233f78d53 100644 --- a/Session/Media Viewing & Editing/ImagePickerController.swift +++ b/Session/Media Viewing & Editing/ImagePickerController.swift @@ -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?