Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ViewImageConfig for iPad mini (6th generation) #653

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ZevEisenberg
Copy link

@ZevEisenberg ZevEisenberg commented Oct 7, 2022

The iPad mini (6th generation) has a wide 3:2 aspect ratio, plus large top and bottom safe area insets, which makes it useful to snapshot test for extreme iPad layout issues.

SwiftUI code used to inspect sizes
import SwiftUI

struct ContentView: View {

    @Environment(\.horizontalSizeClass) var horizontalSizeClass
    @Environment(\.verticalSizeClass) var verticalSizeClass

    var body: some View {
        ZStack(alignment: .top) {
            GeometryReader { proxy in
                Text("Size: \(proxy.size.width, format: .number) x \(proxy.size.height, format: .number)")
                    .frame(maxWidth: .infinity, maxHeight: .infinity)
                    .offset(y: -20)
            }
            .ignoresSafeArea()

            GeometryReader { proxy in
                let insets = proxy.safeAreaInsets
                Text("Safe:\n(top: \(insets.top, format: .number), lead: \(insets.leading, format: .number), bot: \(insets.bottom, format: .number), trail: \(insets.trailing, format: .number))")
                    .frame(maxWidth: .infinity, maxHeight: .infinity)
                    .offset(y: 20)
            }

            VStack {
                Text("Horizontal: \(horizontalSizeClass == .compact ? "compact" : "regular")")
                Text("Vertical: \(verticalSizeClass == .compact ? "compact" : "regular")")
            }
        }
    }
}
Images captured from iPad mini 6th gen (iOS 15.5 simulator) while researching sizes for this
Size Landscape Portrait
Full
1/2 -
1/3
2/3

Snapshots in this PR were recorded on the same simulator/OS combination specified in the Makefile: iPhone 11 Pro, iOS 13.3. I had to tweak the Makefile on my local machine because it specified a scheme that didn't exist, and I suspect it's not up to date for running the latest tests. Let me know if I need to tweak or re-record anything.

@ZevEisenberg
Copy link
Author

ZevEisenberg commented Dec 20, 2023

Bump: this has been rebased on the latest main. The project is still configured to build on iPhone 11 Pro, iOS 13.3, but iOS 13 does not appear to be available as a simulator in Xcode 15, so I captured these snapshots on an iPhone 11 Pro, iOS 15.5 simulator. Presumably, you’ll want to update all the snapshots to a more modern device and then I can rebase these changes.

Are you interested in merging this? I just rediscovered it because we realized we had a bug in our app that we didn’t catch because our snapshots don’t cover this iPad size. We added the iPad manually for this test, but it would be nice if it were built in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant