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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,16 @@ - (BOOL)fb_setAppearance:(FBUIInterfaceAppearance)appearance error:(NSError **)e
[invocation invoke];
return YES;
}

#if __clang_major__ >= 15 || (__clang_major__ >= 14 && __clang_minor__ >= 0 && __clang_patchlevel__ >= 3)
// 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

return YES;
}
#endif

return [[[FBErrorBuilder builder]
withDescriptionFormat:@"Current Xcode SDK does not support appearance changing"]
buildError:error];
Expand Down