Skip to content

Commit

Permalink
chore: use appearance for get as well if available (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Dec 13, 2023
1 parent de124e1 commit 89e233d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,14 @@ - (BOOL)fb_setAppearance:(FBUIInterfaceAppearance)appearance error:(NSError **)e

- (NSNumber *)fb_getAppearance
{
#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")]) {
return [NSNumber numberWithLongLong:[self appearance]];
}
#endif

return [self respondsToSelector:@selector(appearanceMode)]
? [NSNumber numberWithLongLong:[self appearanceMode]]
: nil;
Expand Down

0 comments on commit 89e233d

Please sign in to comment.