From 9bd84978cfbd1c399803f0dca51b0c448cb6bcac Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 11 Jul 2025 17:59:32 +0300 Subject: [PATCH] Work around more Solarium bugs --- iOS/GBLayout.m | 1 - iOS/GBViewController.m | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/iOS/GBLayout.m b/iOS/GBLayout.m index 9cd2c43f9..4ba974efd 100644 --- a/iOS/GBLayout.m +++ b/iOS/GBLayout.m @@ -15,7 +15,6 @@ static double StatusBarHeight(void) if (!ret && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { ret = 32; // iPadOS is buggy af } - NSLog(@"height = %f", ret); } }); return ret; diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m index 9cd9bceb1..d663cb671 100644 --- a/iOS/GBViewController.m +++ b/iOS/GBViewController.m @@ -2114,3 +2114,21 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response } @end + +/* +[UIColor labelColor] is broken in some contexts in iOS 26 and despite being such a critical method + Apple isn't going to fix this in time. */ +@implementation UIColor(SolariumBugs) ++ (UIColor *)labelColor +{ + return [UIColor colorWithDynamicProvider:^UIColor *(UITraitCollection *traitCollection) { + switch (traitCollection.userInterfaceStyle) { + + case UIUserInterfaceStyleUnspecified: + case UIUserInterfaceStyleLight: + return [UIColor blackColor]; + case UIUserInterfaceStyleDark: + return [UIColor whiteColor]; + } + }]; +} +@end