fixed issue with updateStrategy
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ce54965edc
commit
df1e8ee2df
@ -131,7 +131,7 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab
|
|||||||
guard updateStrategy != .alwaysImmediate else { return }
|
guard updateStrategy != .alwaysImmediate else { return }
|
||||||
|
|
||||||
// Update the strategy based on whether the view is in a window
|
// Update the strategy based on whether the view is in a window
|
||||||
updateStrategy = window == nil ? .delayed : .immediate
|
updateStrategy = window != nil ? .delayed : .immediate
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update this view based off of property changes
|
/// Update this view based off of property changes
|
||||||
|
|||||||
@ -86,7 +86,7 @@ open class View: UIView, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
|||||||
guard updateStrategy != .alwaysImmediate else { return }
|
guard updateStrategy != .alwaysImmediate else { return }
|
||||||
|
|
||||||
// Update the strategy based on whether the view is in a window
|
// Update the strategy based on whether the view is in a window
|
||||||
updateStrategy = window == nil ? .delayed : .immediate
|
updateStrategy = window != nil ? .delayed : .immediate
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update this view based off of property changes
|
/// Update this view based off of property changes
|
||||||
|
|||||||
@ -151,7 +151,7 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
|||||||
guard updateStrategy != .alwaysImmediate else { return }
|
guard updateStrategy != .alwaysImmediate else { return }
|
||||||
|
|
||||||
// Update the strategy based on whether the view is in a window
|
// Update the strategy based on whether the view is in a window
|
||||||
updateStrategy = window == nil ? .delayed : .immediate
|
updateStrategy = window != nil ? .delayed : .immediate
|
||||||
}
|
}
|
||||||
|
|
||||||
override open var intrinsicContentSize: CGSize {
|
override open var intrinsicContentSize: CGSize {
|
||||||
|
|||||||
@ -123,7 +123,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
|||||||
guard updateStrategy != .alwaysImmediate else { return }
|
guard updateStrategy != .alwaysImmediate else { return }
|
||||||
|
|
||||||
// Update the strategy based on whether the view is in a window
|
// Update the strategy based on whether the view is in a window
|
||||||
updateStrategy = window == nil ? .delayed : .immediate
|
updateStrategy = window != nil ? .delayed : .immediate
|
||||||
}
|
}
|
||||||
|
|
||||||
open func updateView() {
|
open func updateView() {
|
||||||
|
|||||||
@ -123,6 +123,9 @@ extension Tabs {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
updateStrategy = .alwaysImmediate
|
||||||
|
label.updateStrategy = .alwaysImmediate
|
||||||
|
|
||||||
addSubview(label)
|
addSubview(label)
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
|
|
||||||
|
|||||||
@ -164,6 +164,7 @@ open class Tabs: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
updateStrategy = .alwaysImmediate
|
||||||
scrollView = UIScrollView()
|
scrollView = UIScrollView()
|
||||||
scrollView.translatesAutoresizingMaskIntoConstraints = false
|
scrollView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
scrollView.showsHorizontalScrollIndicator = false
|
scrollView.showsHorizontalScrollIndicator = false
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public protocol Handlerable: AnyObject, Initable, Disabling, Surfaceable {
|
|||||||
extension Handlerable {
|
extension Handlerable {
|
||||||
public func setupNeedsUpdateEvent() {
|
public func setupNeedsUpdateEvent() {
|
||||||
subject
|
subject
|
||||||
.debounce(for: .milliseconds(200), scheduler: RunLoop.main)
|
.debounce(for: .milliseconds(50), scheduler: RunLoop.main)
|
||||||
.sink { [weak self] _ in
|
.sink { [weak self] _ in
|
||||||
self?.updateView()
|
self?.updateView()
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user