Commit a91a3e7f by Daniel Jonathan Committed by GitHub

Merge pull request #1231 from OrkhanAlikhanov/storyboard-fix

Storyboard hot fixes
parents 3e263783 ccaf29fa
......@@ -179,7 +179,9 @@ open class Button: UIButton, Pulseable, PulseableLayer, Themeable {
*/
public override init(frame: CGRect) {
super.init(frame: frame)
/// Set these here to avoid overriding storyboard values
tintColor = Color.blue.base
titleLabel?.font = Theme.font.regular(with: fontSize)
prepare()
}
......@@ -274,7 +276,6 @@ open class Button: UIButton, Pulseable, PulseableLayer, Themeable {
*/
open func prepare() {
contentScaleFactor = Screen.scale
titleLabel?.font = Theme.font.regular(with: fontSize)
prepareVisualLayer()
preparePulse()
applyCurrentTheme()
......
......@@ -205,6 +205,8 @@ open class TextField: UITextField, Themeable {
@IBInspectable
open var placeholderActiveColor = Color.blue.base {
didSet {
/// Keep tintColor update here. See #1229
tintColor = placeholderActiveColor
updatePlaceholderLabelColor()
}
}
......@@ -397,6 +399,9 @@ open class TextField: UITextField, Themeable {
public override init(frame: CGRect) {
super.init(frame: frame)
prepare()
/// Fire didSet here to update tintColor
placeholderActiveColor = { placeholderActiveColor }()
}
open override func layoutSubviews() {
......@@ -533,7 +538,6 @@ fileprivate extension TextField {
/// Updates the placeholderLabel text color.
func updatePlaceholderLabelColor() {
tintColor = placeholderActiveColor
placeholderLabel.textColor = isEditing ? placeholderActiveColor : placeholderNormalColor
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment