Skip to content

Commit

Permalink
fix #879
Browse files Browse the repository at this point in the history
  • Loading branch information
longitachi committed Dec 4, 2023
1 parent a73a358 commit 44f54bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/General/ZLPhotoPreviewSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,10 @@ extension ZLPhotoPreviewSheet: UICollectionViewDataSource, UICollectionViewDeleg
}

extension ZLPhotoPreviewSheet: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
public func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
picker.dismiss(animated: true)
}

public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
picker.dismiss(animated: true) {
let image = info[.originalImage] as? UIImage
Expand Down
4 changes: 4 additions & 0 deletions Sources/General/ZLThumbnailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,10 @@ extension ZLThumbnailViewController: UIScrollViewDelegate {
// MARK: Image picker delegate

extension ZLThumbnailViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
picker.dismiss(animated: true)
}

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
picker.dismiss(animated: true) {
let image = info[.originalImage] as? UIImage
Expand Down

0 comments on commit 44f54bb

Please sign in to comment.