diff --git a/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift b/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift index 4a0369cb..b41f7397 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift @@ -378,9 +378,6 @@ class GalleryItemViewController: UIViewController { 47, // iPhone 12, 12 Pro, 12 Pro Max, 13, 13 Pro, 13 Pro Max, 14, 14 Plus 50, // iPhone 12 mini, 13 mini ] - let islandDeviceTopInsets: [CGFloat] = [ - 59, // iPhone 14 Pro, 14 Pro Max, 15 Pro, 15 Pro Max - ] if notchedDeviceTopInsets.contains(view.safeAreaInsets.top) { // the notch width is not the same for the iPhones 13, // but what we actually want is the same offset from the edges @@ -390,16 +387,18 @@ class GalleryItemViewController: UIViewController { let offset = (earWidth - (shareButton.imageView?.bounds.width ?? 0)) / 2 shareButtonLeadingConstraint.constant = offset closeButtonTrailingConstraint.constant = offset - } else if islandDeviceTopInsets.contains(view.safeAreaInsets.top) { - shareButtonLeadingConstraint.constant = 24 - shareButtonTopConstraint.constant = 24 - closeButtonTrailingConstraint.constant = 24 - closeButtonTopConstraint.constant = 24 - } else { + } else if view.safeAreaInsets.top == 0 { + // square corner devices shareButtonLeadingConstraint.constant = 8 shareButtonTopConstraint.constant = 8 closeButtonTrailingConstraint.constant = 8 closeButtonTopConstraint.constant = 8 + } else { + // dynamic island devices + shareButtonLeadingConstraint.constant = 24 + shareButtonTopConstraint.constant = 24 + closeButtonTrailingConstraint.constant = 24 + closeButtonTopConstraint.constant = 24 } }