ensure updateView() can't be called until setup() is run
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
8723cfa5c3
commit
317cf89fb6
@ -81,7 +81,9 @@ open class Control: UIControl, ViewProtocol, UserInfoable, Clickable {
|
||||
open func initialSetup() {
|
||||
if !initialSetupPerformed {
|
||||
initialSetupPerformed = true
|
||||
shouldUpdateView = false
|
||||
setup()
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,9 @@ open class View: UIView, ViewProtocol, UserInfoable {
|
||||
open func initialSetup() {
|
||||
if !initialSetupPerformed {
|
||||
initialSetupPerformed = true
|
||||
shouldUpdateView = false
|
||||
setup()
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,7 +103,9 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
|
||||
backgroundColor = .clear
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
accessibilityCustomActions = []
|
||||
shouldUpdateView = false
|
||||
setup()
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,7 +209,9 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .staticText
|
||||
textAlignment = .left
|
||||
shouldUpdateView = false
|
||||
setup()
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +105,9 @@ open class TextField: UITextField, ViewProtocol, Errorable {
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||
clipsToBounds = true
|
||||
shouldUpdateView = false
|
||||
setup()
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +112,9 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
||||
initialSetupPerformed = true
|
||||
backgroundColor = .clear
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
shouldUpdateView = false
|
||||
setup()
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user