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

Adopted trait registration API and fixed iOS 17 crash #19

Merged
merged 2 commits into from Sep 12, 2023
Merged

Adopted trait registration API and fixed iOS 17 crash #19

merged 2 commits into from Sep 12, 2023

Conversation

FelixLisczyk
Copy link
Contributor

@FelixLisczyk FelixLisczyk commented Sep 1, 2023

This PR fixes #15

iOS 17 calls traitCollectionDidChange(_:) earlier in the lifecycle when the view properties are not yet initialized. This causes a crash which can be avoided by checking if the view is already visible.

This PR also adopts the new trait registration API in iOS 17: https://developer.apple.com/videos/play/wwdc2023-10057/?time=1196

Note: I've added another commit to restore compatibility with Xcode 14 because the symbols UITraitHorizontalSizeClass and registerForTraitChanges are not available in this version.

Copy link
Owner

@lascic lascic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. We can merge this.

@FelixLisczyk
Copy link
Contributor Author

Great! Could you please merge this PR and create a new release? The Xcode 15 Release Candidate should be available in a few days, and many devs will submit their iOS 17 updates to the App Store shortly after. Thank you!

@lascic lascic merged commit efd1e94 into lascic:main Sep 12, 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

Successfully merging this pull request may close these issues.

Error when executing app in Xcode 15 beta / iOS 17
2 participants