mirror of
https://github.com/ish-app/ish.git
synced 2026-01-25 14:06:40 +00:00
Most of the code assumed it was called on the main thread, but we need to make this explicit now because preference updates will be driven off the UI as well.
36 lines
991 B
Objective-C
36 lines
991 B
Objective-C
//
|
|
// AboutNavigationController.m
|
|
// iSH
|
|
//
|
|
// Created by Theodore Dubois on 10/6/19.
|
|
//
|
|
|
|
#import "AboutNavigationController.h"
|
|
#import "UserPreferences.h"
|
|
#import "NSObject+SaneKVO.h"
|
|
|
|
@interface AboutNavigationController ()
|
|
|
|
@end
|
|
|
|
@implementation AboutNavigationController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
[UserPreferences.shared observe:@[@"theme"] options:NSKeyValueObservingOptionInitial
|
|
owner:self usingBlock:^(typeof(self) self) {
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
if (@available(iOS 13, *)) {
|
|
UIKeyboardAppearance appearance = UserPreferences.shared.theme.keyboardAppearance;
|
|
if (appearance == UIKeyboardAppearanceDark) {
|
|
self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
|
|
} else {
|
|
self.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
|
|
}
|
|
}
|
|
});
|
|
}];
|
|
}
|
|
|
|
@end
|