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

fix: set appearance in iOS 17+ #818

Merged
merged 5 commits into from
Dec 7, 2023
Merged

fix: set appearance in iOS 17+ #818

merged 5 commits into from
Dec 7, 2023

Conversation

KazuCocoa
Copy link
Member

It looks like iOS 17 needs to set appearance via below API.

/*!
 * Get or set the UI style of the device. Uses the `XCUIDeviceAppearance` enum to describe the UI style.
 */
@property (nonatomic) XCUIDeviceAppearance appearance API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);

In my testing, iOS 16.7 worked with setAppearanceMode so it would be safe to check setAppearanceMode first, then appearance

@KazuCocoa KazuCocoa marked this pull request as draft December 7, 2023 06:42
@KazuCocoa KazuCocoa marked this pull request as ready for review December 7, 2023 07:24
// Xcode 14.3.1 can build these values.
// For iOS 17+
if ([self respondsToSelector:NSSelectorFromString(@"appearance")]) {
self.appearance = (XCUIDeviceAppearance) appearance;

Choose a reason for hiding this comment

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

I assume it would still be logical to read this value in the getter instead of the appearanceMode mode one in the getter

@KazuCocoa KazuCocoa merged commit 357a2cb into master Dec 7, 2023
44 of 46 checks passed
@KazuCocoa KazuCocoa deleted the fix-appearance branch December 7, 2023 17:15
github-actions bot pushed a commit that referenced this pull request Dec 7, 2023
## [5.15.4](v5.15.3...v5.15.4) (2023-12-07)

### Bug Fixes

* set appearance in iOS 17+ ([#818](#818)) ([357a2cb](357a2cb))
Copy link

github-actions bot commented Dec 7, 2023

🎉 This PR is included in version 5.15.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants