feat: dismiss image preview when tap empty area

This commit is contained in:
CMK 2022-02-18 19:33:12 +08:00
parent a42acad337
commit 5d38abd659
1 changed files with 5 additions and 1 deletions

View File

@ -222,7 +222,11 @@ extension MediaPreviewViewController: PageboyViewControllerDelegate {
extension MediaPreviewViewController: MediaPreviewImageViewControllerDelegate {
func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, tapGestureRecognizerDidTrigger tapGestureRecognizer: UITapGestureRecognizer) {
// do nothing
let location = tapGestureRecognizer.location(in: viewController.previewImageView.imageView)
let isContainsTap = viewController.previewImageView.imageView.frame.contains(location)
guard !isContainsTap else { return }
dismiss(animated: true, completion: nil)
}
func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, longPressGestureRecognizerDidTrigger longPressGestureRecognizer: UILongPressGestureRecognizer) {