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