Skip to content

Commit

Permalink
fix: set appearance in iOS 17+ (#818)
Browse files Browse the repository at this point in the history
* fix: set appearance in iOS 17+

* only xcode 15+

* set proper clang version

* simplify

* fix Xcode warning
  • Loading branch information
KazuCocoa authored Dec 7, 2023
1 parent 0267f49 commit 357a2cb
Showing 1 changed file with 10 additions and 0 deletions.
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;
return YES;
}
#endif

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

0 comments on commit 357a2cb

Please sign in to comment.