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 }
|
||||
|
||||
// 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
|
||||
|
||||
@ -86,7 +86,7 @@ open class View: UIView, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
guard updateStrategy != .alwaysImmediate else { return }
|
||||
|
||||
// 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
|
||||
|
||||
@ -151,7 +151,7 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
||||
guard updateStrategy != .alwaysImmediate else { return }
|
||||
|
||||
// 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 {
|
||||
|
||||
@ -123,7 +123,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
guard updateStrategy != .alwaysImmediate else { return }
|
||||
|
||||
// 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() {
|
||||
|
||||
@ -123,6 +123,9 @@ extension Tabs {
|
||||
//--------------------------------------------------
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
updateStrategy = .alwaysImmediate
|
||||
label.updateStrategy = .alwaysImmediate
|
||||
|
||||
addSubview(label)
|
||||
accessibilityTraits = .button
|
||||
|
||||
|
||||
@ -164,6 +164,7 @@ open class Tabs: View {
|
||||
//--------------------------------------------------
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
updateStrategy = .alwaysImmediate
|
||||
scrollView = UIScrollView()
|
||||
scrollView.translatesAutoresizingMaskIntoConstraints = false
|
||||
scrollView.showsHorizontalScrollIndicator = false
|
||||
|
||||
@ -25,7 +25,7 @@ public protocol Handlerable: AnyObject, Initable, Disabling, Surfaceable {
|
||||
extension Handlerable {
|
||||
public func setupNeedsUpdateEvent() {
|
||||
subject
|
||||
.debounce(for: .milliseconds(200), scheduler: RunLoop.main)
|
||||
.debounce(for: .milliseconds(50), scheduler: RunLoop.main)
|
||||
.sink { [weak self] _ in
|
||||
self?.updateView()
|
||||
}.store(in: &subscribers)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user