diff --git a/Tusker/Screens/Large Image/LargeImageViewController.swift b/Tusker/Screens/Large Image/LargeImageViewController.swift index b289cf61..d77e4c3a 100644 --- a/Tusker/Screens/Large Image/LargeImageViewController.swift +++ b/Tusker/Screens/Large Image/LargeImageViewController.swift @@ -133,9 +133,13 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate, LargeIma centerImage() // todo: does this need to be in viewDidLayoutSubviews? - // on iPhone X, Xs, Xs Max, 11 Pro, 11 Pro Max, the top safe area inset is 44pts - // on iPhone XR, 11, the top inset is 48pts - if view.safeAreaInsets.top == 44 || view.safeAreaInsets.top == 48 { + let notchedDeviceTopInsets: [CGFloat] = [ + 44, // iPhone X, Xs, Xs Max, 11 Pro, 11 Pro Max + 48, // iPhone XR, 11 + 47, // iPhone 12, 12 Pro, 12 Pro Max + 50, // iPhone 12 mini + ] + if notchedDeviceTopInsets.contains(view.safeAreaInsets.top) { let notchWidth: CGFloat = 209 let earWidth = (view.bounds.width - notchWidth) / 2 let offset = (earWidth - shareButton.bounds.width) / 2