Flip value because it kept going true when nothing changed
This commit is contained in:
parent
f0870bda5d
commit
a1d43e338c
@ -27,7 +27,7 @@ import UIKit
|
||||
|
||||
public var formValidator: FormValidator?
|
||||
|
||||
public var needsUpdateUI = true
|
||||
public var needsUpdateUI = false
|
||||
private var observingForResponses = false
|
||||
private var initialLoadFinished = false
|
||||
private var previousScreenSize = CGSize.zero
|
||||
@ -36,7 +36,7 @@ import UIKit
|
||||
|
||||
/// Checks if the screen width has changed
|
||||
open func screenSizeChanged() -> Bool {
|
||||
return MVMCoreGetterUtility.cgfequalwiththreshold(previousScreenSize.width, view.bounds.size.width, 0.1)
|
||||
return !MVMCoreGetterUtility.cgfequalwiththreshold(previousScreenSize.width, view.bounds.size.width, 0.1)
|
||||
}
|
||||
|
||||
// MARK: - Response handling
|
||||
@ -276,17 +276,18 @@ import UIKit
|
||||
|
||||
open override func viewDidLayoutSubviews() {
|
||||
// Add to fix a constraint bug where the width is zero and things get messed up.
|
||||
guard isViewLoaded,
|
||||
view.bounds.width > 1 else {
|
||||
super.viewDidLayoutSubviews()
|
||||
return
|
||||
guard isViewLoaded, view.bounds.width > 1 else {
|
||||
super.viewDidLayoutSubviews()
|
||||
return
|
||||
}
|
||||
|
||||
if needsUpdateUI || screenSizeChanged() {
|
||||
updateViews()
|
||||
needsUpdateUI = false
|
||||
}
|
||||
|
||||
previousScreenSize = view.bounds.size;
|
||||
|
||||
|
||||
super.viewDidLayoutSubviews()
|
||||
}
|
||||
|
||||
|
||||
@ -273,9 +273,9 @@ import UIKit
|
||||
|
||||
if moleculeLayoutUpdated || heightChanged {
|
||||
delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
|
||||
setNeedsDisplay()
|
||||
}
|
||||
|
||||
setNeedsDisplay()
|
||||
layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user