Skip to content

Commit de7b674

Browse files
author
Leon Keijzer
committed
Make MessageView listen to font changes for all buttons
1 parent b0e5ade commit de7b674

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

MessageViewController/MessageView.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ public final class MessageView: UIView, MessageTextViewListener {
2020
internal var contentView: UIView?
2121
internal var leftButtonAction: Selector?
2222
internal var rightButtonAction: Selector?
23-
public var showLeftButton: Bool = true {
24-
didSet {
25-
if !showLeftButton {
26-
leftButton.removeFromSuperview()
27-
setNeedsLayout()
28-
}
29-
}
30-
}
23+
public var showLeftButton: Bool = true
3124

3225
public enum buttonType {
3326
case left
@@ -39,9 +32,7 @@ public final class MessageView: UIView, MessageTextViewListener {
3932

4033
backgroundColor = .white
4134

42-
if showLeftButton {
43-
addSubview(leftButton)
44-
}
35+
addSubview(leftButton)
4536
addSubview(textView)
4637
addSubview(rightButton)
4738
layer.addSublayer(topBorderLayer)
@@ -96,6 +87,8 @@ public final class MessageView: UIView, MessageTextViewListener {
9687
public var font: UIFont? {
9788
get { return textView.font }
9889
set {
90+
leftButton.titleLabel?.font = newValue
91+
rightButton.titleLabel?.font = newValue
9992
textView.font = newValue
10093
delegate?.wantsLayout(messageView: self)
10194
}

0 commit comments

Comments
 (0)