From 0b6ef6517bb01454eaddda305e3bc44a16f655c7 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 12 Sep 2020 11:40:50 -0400 Subject: [PATCH] Fix gallery action buttons not being centered in device "ears" on iPhone XR and 11 --- Tusker/Screens/Large Image/LargeImageViewController.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Large Image/LargeImageViewController.swift b/Tusker/Screens/Large Image/LargeImageViewController.swift index 1f5f0150..b289cf61 100644 --- a/Tusker/Screens/Large Image/LargeImageViewController.swift +++ b/Tusker/Screens/Large Image/LargeImageViewController.swift @@ -133,8 +133,9 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate, LargeIma centerImage() // todo: does this need to be in viewDidLayoutSubviews? - if view.safeAreaInsets.top == 44 { - // running on iPhone X style notched device + // 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 notchWidth: CGFloat = 209 let earWidth = (view.bounds.width - notchWidth) / 2 let offset = (earWidth - shareButton.bounds.width) / 2