mirror of
https://github.com/ish-app/ish.git
synced 2026-01-25 14:06:40 +00:00
40 lines
1.1 KiB
Objective-C
40 lines
1.1 KiB
Objective-C
//
|
|
// AboutNavigationController.m
|
|
// iSH
|
|
//
|
|
// Created by Theodore Dubois on 10/6/19.
|
|
//
|
|
|
|
#import "AboutNavigationController.h"
|
|
#import "UserPreferences.h"
|
|
|
|
@interface AboutNavigationController ()
|
|
|
|
@end
|
|
|
|
@implementation AboutNavigationController
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
[[UserPreferences shared] addObserver:self forKeyPath:@"theme" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionInitial context:nil];
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[[UserPreferences shared] removeObserver:self forKeyPath:@"theme"];
|
|
}
|
|
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
|
|
if (@available(iOS 13, *)) {
|
|
if ([keyPath isEqualToString:@"theme"]) {
|
|
UIKeyboardAppearance appearance = UserPreferences.shared.theme.keyboardAppearance;
|
|
if (appearance == UIKeyboardAppearanceDark) {
|
|
self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
|
|
} else {
|
|
self.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@end
|