Fix controls in large image/gallery not hiding/showing on zoom

Closes #58
This commit is contained in:
Shadowfacts 2019-11-28 21:51:24 -05:00
parent d5232c0b03
commit 06442b5629
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 12 deletions

View File

@ -71,16 +71,6 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate {
modalPresentationStyle = .fullScreen modalPresentationStyle = .fullScreen
} }
// init(gifData: Data?, description: String?, sourceFrame: CGRect, sourceCornerRadius: CGFloat, router: AppRouter) {
// self.router = router
// self.gifData = gifData
// self.imageDescription = description
// self.originFrame = sourceFrame
// self.originCornerRadius = sourceCornerRadius
//
// super.init(nibName: "LargeImageViewController", bundle: nil)
// }
required init?(coder aDecoder: NSCoder) { required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
@ -172,9 +162,9 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate {
let prevZoomScale = self.prevZoomScale ?? scrollView.minimumZoomScale let prevZoomScale = self.prevZoomScale ?? scrollView.minimumZoomScale
if scrollView.zoomScale <= scrollView.minimumZoomScale { if scrollView.zoomScale <= scrollView.minimumZoomScale {
controlsVisible = true setControlsVisible(true, animated: true)
} else if scrollView.zoomScale > prevZoomScale { } else if scrollView.zoomScale > prevZoomScale {
controlsVisible = false setControlsVisible(false, animated: true)
} }
self.prevZoomScale = scrollView.zoomScale self.prevZoomScale = scrollView.zoomScale
} }