Convert OWSSearchBar to Swift.
This commit is contained in:
parent
c457cefc94
commit
56e126bda6
@ -96,7 +96,6 @@
|
||||
3402AA6B271D9DFC0084CBAE /* Wallpaper+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A955AA271B510500B05242 /* Wallpaper+Constants.swift */; };
|
||||
3402AA6C271D9E180084CBAE /* ImageEditorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95562271B510400B05242 /* ImageEditorView.swift */; };
|
||||
3402AA6D271D9E180084CBAE /* LinkPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95515271B510400B05242 /* LinkPreviewView.swift */; };
|
||||
3402AA6E271D9E180084CBAE /* OWSSearchBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A95540271B510400B05242 /* OWSSearchBar.m */; };
|
||||
3402AA6F271D9E180084CBAE /* VideoEditorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A9551C271B510400B05242 /* VideoEditorView.swift */; };
|
||||
3402AA70271D9E180084CBAE /* OWSStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A9554E271B510400B05242 /* OWSStackView.swift */; };
|
||||
3402AA71271D9E180084CBAE /* OWSLayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95538271B510400B05242 /* OWSLayerView.swift */; };
|
||||
@ -116,7 +115,6 @@
|
||||
3402AA80271D9E180084CBAE /* TappableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95532271B510400B05242 /* TappableView.swift */; };
|
||||
3402AA82271D9E180084CBAE /* DisappearingTimerConfigurationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A9551F271B510400B05242 /* DisappearingTimerConfigurationView.swift */; };
|
||||
3402AA83271D9E180084CBAE /* OWSFlatButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95511271B510400B05242 /* OWSFlatButton.swift */; };
|
||||
3402AA85271D9E180084CBAE /* OWSSearchBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 34A95520271B510400B05242 /* OWSSearchBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3402AA86271D9E180084CBAE /* ResizingScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95531271B510400B05242 /* ResizingScrollView.swift */; };
|
||||
3402AA87271D9E180084CBAE /* CVCellMeasurement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95523271B510400B05242 /* CVCellMeasurement.swift */; };
|
||||
3402AA88271D9E180084CBAE /* ContactCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A9550B271B510400B05242 /* ContactCellView.swift */; };
|
||||
@ -925,6 +923,7 @@
|
||||
7649813F2A2306DA00EC1287 /* SMEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7649813E2A2306DA00EC1287 /* SMEnvironment.swift */; };
|
||||
764981432A230F2C00EC1287 /* MockSMEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 764981422A230F2C00EC1287 /* MockSMEnvironment.swift */; };
|
||||
764981452A23194F00EC1287 /* CVItemViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 764981442A23194F00EC1287 /* CVItemViewModel.swift */; };
|
||||
764FE0432A2F049C004D2804 /* OWSSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 764FE0422A2F049C004D2804 /* OWSSearchBar.swift */; };
|
||||
764FE03F2A2EC2E2004D2804 /* UIViewController+Permissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 764FE03E2A2EC2E2004D2804 /* UIViewController+Permissions.swift */; };
|
||||
764FE0452A2F0C0F004D2804 /* QuotedReplyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 764FE0442A2F0C0F004D2804 /* QuotedReplyModel.swift */; };
|
||||
765283AE2A00D8B4004583A9 /* OWSTableContents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 765283AD2A00D8B4004583A9 /* OWSTableContents.swift */; };
|
||||
@ -2775,7 +2774,6 @@
|
||||
34A9551D271B510400B05242 /* ManualLayoutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManualLayoutView.swift; sourceTree = "<group>"; };
|
||||
34A9551E271B510400B05242 /* ContactsViewHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsViewHelper.swift; sourceTree = "<group>"; };
|
||||
34A9551F271B510400B05242 /* DisappearingTimerConfigurationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisappearingTimerConfigurationView.swift; sourceTree = "<group>"; };
|
||||
34A95520271B510400B05242 /* OWSSearchBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OWSSearchBar.h; sourceTree = "<group>"; };
|
||||
34A95522271B510400B05242 /* CVTextLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CVTextLabel.swift; sourceTree = "<group>"; };
|
||||
34A95523271B510400B05242 /* CVCellMeasurement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CVCellMeasurement.swift; sourceTree = "<group>"; };
|
||||
34A95524271B510400B05242 /* CVUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CVUtils.swift; sourceTree = "<group>"; };
|
||||
@ -2798,7 +2796,6 @@
|
||||
34A9553D271B510400B05242 /* OWSActionSheets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSActionSheets.swift; sourceTree = "<group>"; };
|
||||
34A9553E271B510400B05242 /* TextViewWithPlaceholder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextViewWithPlaceholder.swift; sourceTree = "<group>"; };
|
||||
34A9553F271B510400B05242 /* CircleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleView.swift; sourceTree = "<group>"; };
|
||||
34A95540271B510400B05242 /* OWSSearchBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OWSSearchBar.m; sourceTree = "<group>"; };
|
||||
34A95543271B510400B05242 /* ConversationAvatarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversationAvatarView.swift; sourceTree = "<group>"; };
|
||||
34A95544271B510400B05242 /* OWSNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSNavigationBar.swift; sourceTree = "<group>"; };
|
||||
34A95545271B510400B05242 /* AvatarImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvatarImageView.swift; sourceTree = "<group>"; };
|
||||
@ -3400,6 +3397,7 @@
|
||||
7649813E2A2306DA00EC1287 /* SMEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SMEnvironment.swift; sourceTree = "<group>"; };
|
||||
764981422A230F2C00EC1287 /* MockSMEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockSMEnvironment.swift; sourceTree = "<group>"; };
|
||||
764981442A23194F00EC1287 /* CVItemViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CVItemViewModel.swift; sourceTree = "<group>"; };
|
||||
764FE0422A2F049C004D2804 /* OWSSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSSearchBar.swift; sourceTree = "<group>"; };
|
||||
764FE03E2A2EC2E2004D2804 /* UIViewController+Permissions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Permissions.swift"; sourceTree = "<group>"; };
|
||||
764FE0442A2F0C0F004D2804 /* QuotedReplyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuotedReplyModel.swift; sourceTree = "<group>"; };
|
||||
765283AD2A00D8B4004583A9 /* OWSTableContents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSTableContents.swift; sourceTree = "<group>"; };
|
||||
@ -5693,8 +5691,7 @@
|
||||
34A95511271B510400B05242 /* OWSFlatButton.swift */,
|
||||
34A95538271B510400B05242 /* OWSLayerView.swift */,
|
||||
34A95544271B510400B05242 /* OWSNavigationBar.swift */,
|
||||
34A95520271B510400B05242 /* OWSSearchBar.h */,
|
||||
34A95540271B510400B05242 /* OWSSearchBar.m */,
|
||||
764FE0422A2F049C004D2804 /* OWSSearchBar.swift */,
|
||||
34A9554E271B510400B05242 /* OWSStackView.swift */,
|
||||
F9C8CFCF293580D00094469C /* OWSTextField.swift */,
|
||||
760981892936EC8D008F8300 /* OWSTextView.swift */,
|
||||
@ -9502,7 +9499,6 @@
|
||||
34A955B4271B53F600B05242 /* BlockListUIUtils.h in Headers */,
|
||||
3402AA9E271D9E180084CBAE /* ContactsViewHelper.h in Headers */,
|
||||
3402AA5D271D9DCD0084CBAE /* OWSNavigationControllerBase.h in Headers */,
|
||||
3402AA85271D9E180084CBAE /* OWSSearchBar.h in Headers */,
|
||||
34A954CF271B4D0700B05242 /* SignalUI-Prefix.pch in Headers */,
|
||||
34A954BA271A471300B05242 /* SignalUI.h in Headers */,
|
||||
3402A9E9271D97090084CBAE /* UIView+SignalUI.h in Headers */,
|
||||
@ -10856,7 +10852,7 @@
|
||||
3402AAB1271D9E180084CBAE /* OWSNavigationBar.swift in Sources */,
|
||||
665EF86D290C385B00F490D2 /* OWSNavigationController.swift in Sources */,
|
||||
3402AA58271D9DCD0084CBAE /* OWSNavigationControllerBase.m in Sources */,
|
||||
3402AA6E271D9E180084CBAE /* OWSSearchBar.m in Sources */,
|
||||
764FE0432A2F049C004D2804 /* OWSSearchBar.swift in Sources */,
|
||||
3402AA70271D9E180084CBAE /* OWSStackView.swift in Sources */,
|
||||
765283AE2A00D8B4004583A9 /* OWSTableContents.swift in Sources */,
|
||||
765283B22A00D8EC004583A9 /* OWSTableItem.swift in Sources */,
|
||||
|
||||
@ -262,7 +262,6 @@ final public class Theme: NSObject {
|
||||
isDarkThemeEnabled ? darkThemeWashColor : .ows_gray05
|
||||
}
|
||||
|
||||
@objc
|
||||
public class var primaryTextColor: UIColor {
|
||||
isDarkThemeEnabled ? darkThemePrimaryColor : lightThemePrimaryColor
|
||||
}
|
||||
@ -428,7 +427,6 @@ final public class Theme: NSObject {
|
||||
|
||||
// MARK: - Keyboard
|
||||
|
||||
@objc
|
||||
public class var keyboardAppearance: UIKeyboardAppearance {
|
||||
isDarkThemeEnabled ? darkThemeKeyboardAppearance : .default
|
||||
}
|
||||
@ -449,15 +447,12 @@ final public class Theme: NSObject {
|
||||
|
||||
// MARK: - Search Bar
|
||||
|
||||
@objc
|
||||
public class var barStyle: UIBarStyle {
|
||||
isDarkThemeEnabled ? .black : .default
|
||||
}
|
||||
|
||||
@objc
|
||||
public class var searchFieldBackgroundColor: UIColor { washColor }
|
||||
|
||||
@objc
|
||||
public class var searchFieldElevatedBackgroundColor: UIColor {
|
||||
isDarkThemeEnabled ? .ows_gray75 : .ows_gray12
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ FOUNDATION_EXPORT const unsigned char SignalUIVersionString[];
|
||||
#import <SignalUI/BlockListUIUtils.h>
|
||||
#import <SignalUI/ContactsViewHelper.h>
|
||||
#import <SignalUI/OWSNavigationControllerBase.h>
|
||||
#import <SignalUI/OWSSearchBar.h>
|
||||
#import <SignalUI/UIView+SignalUI.h>
|
||||
#import <SignalUI/UIViewController+OWS.h>
|
||||
#import <SignalUI/ViewControllerUtils.h>
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
//
|
||||
// Copyright 2017 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, OWSSearchBarStyle) {
|
||||
OWSSearchBarStyle_Default
|
||||
};
|
||||
|
||||
@interface OWSSearchBar : UISearchBar
|
||||
|
||||
@property (nonatomic, nullable) UIColor *searchFieldBackgroundColorOverride;
|
||||
|
||||
+ (void)applyThemeToSearchBar:(UISearchBar *)searchBar;
|
||||
+ (void)applyThemeToSearchBar:(UISearchBar *)searchBar style:(OWSSearchBarStyle)style;
|
||||
|
||||
- (void)switchToStyle:(OWSSearchBarStyle)style;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -1,148 +0,0 @@
|
||||
//
|
||||
// Copyright 2018 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
#import "OWSSearchBar.h"
|
||||
#import "UIView+SignalUI.h"
|
||||
#import <SignalUI/SignalUI-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSSearchBar ()
|
||||
|
||||
@property (nonatomic) OWSSearchBarStyle currentStyle;
|
||||
|
||||
@end
|
||||
|
||||
@implementation OWSSearchBar
|
||||
|
||||
@synthesize searchFieldBackgroundColorOverride = _searchFieldBackgroundColorOverride;
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if (self = [super init]) {
|
||||
[self ows_configure];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self ows_configure];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
if (self = [super initWithCoder:aDecoder]) {
|
||||
[self ows_configure];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)ows_configure
|
||||
{
|
||||
_currentStyle = OWSSearchBarStyle_Default;
|
||||
|
||||
[self ows_applyTheme];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(themeDidChange:)
|
||||
name:NSNotification.ThemeDidChange
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)ows_applyTheme
|
||||
{
|
||||
[self.class applyThemeToSearchBar:self style:self.currentStyle];
|
||||
}
|
||||
|
||||
+ (void)applyThemeToSearchBar:(UISearchBar *)searchBar
|
||||
{
|
||||
[self applyThemeToSearchBar:searchBar style:OWSSearchBarStyle_Default];
|
||||
}
|
||||
|
||||
+ (void)applyThemeToSearchBar:(UISearchBar *)searchBar style:(OWSSearchBarStyle)style
|
||||
{
|
||||
OWSAssertIsOnMainThread();
|
||||
|
||||
UIColor *foregroundColor = Theme.secondaryTextAndIconColor;
|
||||
searchBar.tintColor = Theme.secondaryTextAndIconColor;
|
||||
searchBar.barStyle = Theme.barStyle;
|
||||
searchBar.barTintColor = Theme.backgroundColor;
|
||||
|
||||
// Hide searchBar border.
|
||||
// Alternatively we could hide the border by using `UISearchBarStyleMinimal`, but that causes an issue when toggling
|
||||
// from light -> dark -> light theme wherein the textField background color appears darker than it should
|
||||
// (regardless of our re-setting textfield.backgroundColor below).
|
||||
searchBar.backgroundImage = [UIImage new];
|
||||
|
||||
if (Theme.isDarkThemeEnabled) {
|
||||
UIImage *clearImage = [UIImage imageNamed:@"searchbar_clear"];
|
||||
[searchBar setImage:[clearImage asTintedImageWithColor:foregroundColor]
|
||||
forSearchBarIcon:UISearchBarIconClear
|
||||
state:UIControlStateNormal];
|
||||
|
||||
UIImage *searchImage = [UIImage imageNamed:@"searchbar_search"];
|
||||
[searchBar setImage:[searchImage asTintedImageWithColor:foregroundColor]
|
||||
forSearchBarIcon:UISearchBarIconSearch
|
||||
state:UIControlStateNormal];
|
||||
} else {
|
||||
[searchBar setImage:nil forSearchBarIcon:UISearchBarIconClear state:UIControlStateNormal];
|
||||
|
||||
[searchBar setImage:nil forSearchBarIcon:UISearchBarIconSearch state:UIControlStateNormal];
|
||||
}
|
||||
|
||||
UIColor *searchFieldBackgroundColor = Theme.searchFieldBackgroundColor;
|
||||
if ([searchBar isKindOfClass:[OWSSearchBar class]]
|
||||
&& ((OWSSearchBar *)searchBar).searchFieldBackgroundColorOverride) {
|
||||
searchFieldBackgroundColor = ((OWSSearchBar *)searchBar).searchFieldBackgroundColorOverride;
|
||||
}
|
||||
|
||||
[searchBar traverseViewHierarchyDownwardWithVisitor:^(UIView *view) {
|
||||
if ([view isKindOfClass:[UITextField class]]) {
|
||||
UITextField *textField = (UITextField *)view;
|
||||
textField.backgroundColor = searchFieldBackgroundColor;
|
||||
textField.textColor = Theme.primaryTextColor;
|
||||
textField.keyboardAppearance = Theme.keyboardAppearance;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)switchToStyle:(OWSSearchBarStyle)style
|
||||
{
|
||||
self.currentStyle = style;
|
||||
[self ows_applyTheme];
|
||||
}
|
||||
|
||||
- (void)themeDidChange:(NSNotification *)notification
|
||||
{
|
||||
OWSAssertIsOnMainThread();
|
||||
|
||||
[self ows_applyTheme];
|
||||
}
|
||||
|
||||
- (void)setSearchFieldBackgroundColorOverride:(nullable UIColor *)searchFieldBackgroundColorOverride
|
||||
{
|
||||
OWSAssertIsOnMainThread();
|
||||
|
||||
_searchFieldBackgroundColorOverride = searchFieldBackgroundColorOverride;
|
||||
|
||||
[self ows_applyTheme];
|
||||
}
|
||||
|
||||
- (nullable UIColor *)searchFieldBackgroundColorOverride
|
||||
{
|
||||
OWSAssertIsOnMainThread();
|
||||
return _searchFieldBackgroundColorOverride;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
94
SignalUI/Views/OWSSearchBar.swift
Normal file
94
SignalUI/Views/OWSSearchBar.swift
Normal file
@ -0,0 +1,94 @@
|
||||
//
|
||||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class OWSSearchBar: UISearchBar {
|
||||
|
||||
public override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
configure()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
configure()
|
||||
}
|
||||
|
||||
// MARK: -
|
||||
|
||||
public var searchFieldBackgroundColorOverride: UIColor? {
|
||||
didSet {
|
||||
applyTheme()
|
||||
}
|
||||
}
|
||||
|
||||
private func configure() {
|
||||
applyTheme()
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeDidChange, object: nil)
|
||||
}
|
||||
|
||||
// MARK: Theme
|
||||
|
||||
public static func applyTheme(to searchBar: UISearchBar) {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
searchBar.tintColor = Theme.secondaryTextAndIconColor
|
||||
searchBar.barStyle = Theme.barStyle
|
||||
searchBar.barTintColor = Theme.backgroundColor
|
||||
|
||||
// Hide searchBar border.
|
||||
// Alternatively we could hide the border by using `UISearchBarStyleMinimal`, but that causes an issue when toggling
|
||||
// from light -> dark -> light theme wherein the textField background color appears darker than it should
|
||||
// (regardless of our re-setting textfield.backgroundColor below).
|
||||
searchBar.backgroundImage = UIImage()
|
||||
|
||||
if Theme.isDarkThemeEnabled {
|
||||
let foregroundColor = Theme.secondaryTextAndIconColor
|
||||
|
||||
let clearImage = UIImage(imageLiteralResourceName: "searchbar_clear")
|
||||
searchBar.setImage(
|
||||
clearImage.asTintedImage(color: foregroundColor),
|
||||
for: .clear,
|
||||
state: .normal
|
||||
)
|
||||
|
||||
let searchImage = UIImage(imageLiteralResourceName: "searchbar_search")
|
||||
searchBar.setImage(
|
||||
searchImage.asTintedImage(color: foregroundColor),
|
||||
for: .search,
|
||||
state: .normal
|
||||
)
|
||||
} else {
|
||||
searchBar.setImage(nil, for: .clear, state: .normal)
|
||||
searchBar.setImage(nil, for: .search, state: .normal)
|
||||
}
|
||||
|
||||
let searchFieldBackgroundColor: UIColor
|
||||
if let owsSearchBar = searchBar as? OWSSearchBar, let colorOverride = owsSearchBar.searchFieldBackgroundColorOverride {
|
||||
searchFieldBackgroundColor = colorOverride
|
||||
} else {
|
||||
searchFieldBackgroundColor = Theme.searchFieldBackgroundColor
|
||||
}
|
||||
|
||||
searchBar.traverseHierarchyDownward { view in
|
||||
guard let textField = view as? UITextField else { return }
|
||||
textField.backgroundColor = searchFieldBackgroundColor
|
||||
textField.textColor = Theme.primaryTextColor
|
||||
textField.keyboardAppearance = Theme.keyboardAppearance
|
||||
}
|
||||
}
|
||||
|
||||
private func applyTheme() {
|
||||
Self.applyTheme(to: self)
|
||||
}
|
||||
|
||||
@objc
|
||||
private func themeDidChange(_ notification: Notification) {
|
||||
AssertIsOnMainThread()
|
||||
applyTheme()
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user