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

Trait Overrides support for iOS 17 #798

Open
AllDmeat opened this issue Oct 27, 2023 · 0 comments
Open

Trait Overrides support for iOS 17 #798

AllDmeat opened this issue Oct 27, 2023 · 0 comments

Comments

@AllDmeat
Copy link

AllDmeat commented Oct 27, 2023

Describe the bug
We were using SnapshotTesting for testing Dynamic Type with views being autosized using systemLayoutSizeFitting. Similar strategy can be found at #727.

This year Apple updated trait system at iOS 17. You can learn more at WWDC'23 session Unleash the UIKit trait system.
Traits are now applied only after the view has been added to the view hierarchy, rather than before.

At the same time, the SnapshotTesting library continues to request the view size before it is added to the hierarchy. Because of these two behaviors, we have a conflict and cannot test Dynamic Type with autosizing views.

To Reproduce
SnapshotDemo.zip

Expected behavior
Size is being requested after the view is added to the view hierarchy and all traitOverrides are applied.

Environment

  • swift-snapshot-testing 1.14.2
  • Xcode 15.0.1
  • Swift 5.9
  • iOS 17
@AllDmeat AllDmeat changed the title Wrong size for views with non-default preferredContentSizeCategory at iOS 17 Trait Overrides support for iOS 17 Dec 1, 2023
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

No branches or pull requests

1 participant