File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class ButtonHeaderView<Action>: UIButton {
57
57
58
58
private func configureSubviews( ) {
59
59
titleLabel? . textAlignment = . center
60
- titleLabel ? . textColor = UIColor . otpForegroundColor
60
+ setTitleColor ( . otpForegroundColor , for : UIControlState . normal )
61
61
titleLabel? . font = UIFont . systemFont ( ofSize: 16 , weight: UIFontWeightLight)
62
62
63
63
addTarget ( self , action: #selector( ButtonHeaderView . buttonWasPressed) , for: . touchUpInside)
Original file line number Diff line number Diff line change @@ -34,8 +34,17 @@ class OTPAppDelegate: UIResponder, UIApplicationDelegate {
34
34
let app = AppController ( )
35
35
36
36
func application( _ application: UIApplication , didFinishLaunchingWithOptions launchOptions: [ UIApplicationLaunchOptionsKey : Any ] ? ) -> Bool {
37
- let barButtonAttributes = [ NSFontAttributeName: UIFont . systemFont ( ofSize: 17 , weight: UIFontWeightLight) ]
38
- UIBarButtonItem . appearance ( ) . setTitleTextAttributes ( barButtonAttributes, for: . normal)
37
+ let barButtonItemFont = UIFont . systemFont ( ofSize: 17 , weight: UIFontWeightLight)
38
+ let fontAttributes = [ NSFontAttributeName: barButtonItemFont]
39
+ UIBarButtonItem . appearance ( ) . setTitleTextAttributes ( fontAttributes, for: . normal)
40
+ UIBarButtonItem . appearance ( ) . setTitleTextAttributes ( fontAttributes, for: . highlighted)
41
+ UIBarButtonItem . appearance ( ) . setTitleTextAttributes ( fontAttributes, for: . selected)
42
+
43
+ let disabledAttributes = [
44
+ NSFontAttributeName: barButtonItemFont,
45
+ NSForegroundColorAttributeName: UIColor . otpBarForegroundColor. withAlphaComponent ( 0.3 ) ,
46
+ ]
47
+ UIBarButtonItem . appearance ( ) . setTitleTextAttributes ( disabledAttributes, for: . disabled)
39
48
40
49
// Restore white-on-black style
41
50
SVProgressHUD . setForegroundColor ( . otpLightColor)
You can’t perform that action at this time.
0 commit comments