From 0f5489e75fe1d235c983cef9897421279aa105e5 Mon Sep 17 00:00:00 2001 From: Robert Manson Date: Sun, 13 Jul 2025 16:28:48 -0700 Subject: [PATCH] Add iPhone 16 Pro Max To support generating 16.9 screen size screenshots. Inset dimensions taken from here https://useyourloaf.com/blog/iphone-16-screen-sizes/ --- Sources/SnapshotTesting/Common/View.swift | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Sources/SnapshotTesting/Common/View.swift b/Sources/SnapshotTesting/Common/View.swift index 753153749..9c56e84de 100644 --- a/Sources/SnapshotTesting/Common/View.swift +++ b/Sources/SnapshotTesting/Common/View.swift @@ -242,6 +242,23 @@ return .init(safeArea: safeArea, size: size, traits: .iPhone13ProMax(orientation)) } + public static let iPhone16ProMax = ViewImageConfig.iPhone16ProMax(.portrait) + + public static func iPhone16ProMax(_ orientation: Orientation) -> ViewImageConfig { + let safeArea: UIEdgeInsets + let size: CGSize + switch orientation { + case .landscape: + safeArea = .init(top: 0, left: 62, bottom: 21, right: 62) + size = .init(width: 956, height: 440) + case .portrait: + safeArea = .init(top: 62, left: 0, bottom: 34, right: 0) + size = .init(width: 440, height: 956) + } + + return .init(safeArea: safeArea, size: size, traits: .iPhone16ProMax(orientation)) + } + public static let iPadMini = ViewImageConfig.iPadMini(.landscape) public static func iPadMini(_ orientation: Orientation) -> ViewImageConfig { @@ -773,6 +790,11 @@ } } + public static func iPhone16ProMax(_ orientation: ViewImageConfig.Orientation) + -> UITraitCollection { + return Self.iPhone13ProMax(orientation) + } + public static let iPadMini = iPad public static let iPadMini_Compact_SplitView = iPadCompactSplitView public static let iPad9_7 = iPad