diff --git a/Tusker/Screens/Large Image/LargeImageViewController.swift b/Tusker/Screens/Large Image/LargeImageViewController.swift index 5658b1d59f..45890c523e 100644 --- a/Tusker/Screens/Large Image/LargeImageViewController.swift +++ b/Tusker/Screens/Large Image/LargeImageViewController.swift @@ -37,8 +37,6 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate { @IBOutlet weak var bottomControlsView: UIView! @IBOutlet weak var descriptionLabel: UILabel! - var initializedTopControlsConstrains = false - var image: UIImage? var gifData: Data? var imageDescription: String? @@ -120,16 +118,13 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate { centerImage() - if !initializedTopControlsConstrains { - initializedTopControlsConstrains = true - if view.safeAreaInsets.top == 44 { - // running on iPhone X style notched device - let notchWidth: CGFloat = 209 - let earWidth = (view.bounds.width - notchWidth) / 2 - let offset = (earWidth - shareButton.bounds.width) / 2 - shareButtonLeadingConstraint.constant = offset - closeButtonTrailingConstraint.constant = offset - } + if view.safeAreaInsets.top == 44 { + // running on iPhone X style notched device + let notchWidth: CGFloat = 209 + let earWidth = (view.bounds.width - notchWidth) / 2 + let offset = (earWidth - shareButton.bounds.width) / 2 + shareButtonLeadingConstraint.constant = offset + closeButtonTrailingConstraint.constant = offset } }