From ea143ea0dd18a6b17332de9098ad1aa0c11c5c34 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 14 Jun 2019 14:46:19 -0700 Subject: [PATCH] Large Image VC: Hide home indicator when controls hidden --- Tusker/Screens/Large Image/LargeImageViewController.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Large Image/LargeImageViewController.swift b/Tusker/Screens/Large Image/LargeImageViewController.swift index 8cdb2e7391..7661a6bf25 100644 --- a/Tusker/Screens/Large Image/LargeImageViewController.swift +++ b/Tusker/Screens/Large Image/LargeImageViewController.swift @@ -43,6 +43,8 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate { var controlsVisible = true { didSet { + setNeedsUpdateOfHomeIndicatorAutoHidden() + UIView.animate(withDuration: 0.2) { let topOffset = self.controlsVisible ? 0 : -self.topControlsView.bounds.height self.topControlsView.transform = CGAffineTransform(translationX: 0, y: topOffset) @@ -60,7 +62,11 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate { return true } - init(image: UIImage, description: String?, sourceFrame: CGRect, sourceCornerRadius: CGFloat) { + override var prefersHomeIndicatorAutoHidden: Bool { + return !controlsVisible + } + + init(image: UIImage, description: String?, sourceFrame: CGRect?, sourceCornerRadius: CGFloat?) { self.image = image self.imageDescription = description self.originFrame = sourceFrame