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() {
|
open func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
|
shouldUpdateView = false
|
||||||
setup()
|
setup()
|
||||||
|
shouldUpdateView = true
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,9 @@ open class View: UIView, ViewProtocol, UserInfoable {
|
|||||||
open func initialSetup() {
|
open func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
|
shouldUpdateView = false
|
||||||
setup()
|
setup()
|
||||||
|
shouldUpdateView = true
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,9 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
|
|||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
translatesAutoresizingMaskIntoConstraints = false
|
||||||
accessibilityCustomActions = []
|
accessibilityCustomActions = []
|
||||||
|
shouldUpdateView = false
|
||||||
setup()
|
setup()
|
||||||
|
shouldUpdateView = true
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -209,7 +209,9 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
|||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .staticText
|
accessibilityTraits = .staticText
|
||||||
textAlignment = .left
|
textAlignment = .left
|
||||||
|
shouldUpdateView = false
|
||||||
setup()
|
setup()
|
||||||
|
shouldUpdateView = true
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,7 +105,9 @@ open class TextField: UITextField, ViewProtocol, Errorable {
|
|||||||
translatesAutoresizingMaskIntoConstraints = false
|
translatesAutoresizingMaskIntoConstraints = false
|
||||||
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||||
clipsToBounds = true
|
clipsToBounds = true
|
||||||
|
shouldUpdateView = false
|
||||||
setup()
|
setup()
|
||||||
|
shouldUpdateView = true
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,9 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
shouldUpdateView = false
|
||||||
setup()
|
setup()
|
||||||
|
shouldUpdateView = true
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user