trying to deal with rendering issues

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-08-22 15:11:12 -05:00
parent 359a729379
commit d336b8dfda
5 changed files with 20 additions and 4 deletions

View File

@ -30,7 +30,9 @@ public protocol SelectorControlable: Control, Changeable {
/// Base Class used to build out a Selector control. /// Base Class used to build out a Selector control.
@objcMembers @objcMembers
@objc(VDSSelectorBase) @objc(VDSSelectorBase)
open class SelectorBase: Control, SelectorControlable { open class SelectorBase: Control, SelectorControlable, ParentViewProtocol {
public var children: [any ViewProtocol] { [selectorView] }
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
//-------------------------------------------------- //--------------------------------------------------

View File

@ -39,7 +39,8 @@ extension SelectorGroupSingleSelect {
} }
/// Base Class used for any Grouped Form Control of a Selector Type. /// Base Class used for any Grouped Form Control of a Selector Type.
open class SelectorGroupBase<SelectorItemType: Groupable>: Control, SelectorGroup, Changeable { open class SelectorGroupBase<SelectorItemType: Groupable>: Control, SelectorGroup, Changeable, ParentViewProtocol {
public var children: [any ViewProtocol] { items }
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Private Properties // MARK: - Private Properties

View File

@ -11,7 +11,8 @@ import Combine
import VDSCoreTokens import VDSCoreTokens
/// Base Class used to build out a SelectorControlable control. /// Base Class used to build out a SelectorControlable control.
open class SelectorItemBase<Selector: SelectorBase>: Control, Errorable, Changeable, Groupable { open class SelectorItemBase<Selector: SelectorBase>: Control, Errorable, Changeable, Groupable, ParentViewProtocol {
public var children: [any ViewProtocol] { [label, childLabel, errorLabel, selectorView] }
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializers // MARK: - Initializers

View File

@ -14,7 +14,8 @@ import VDSCoreTokens
/// that are used within a ``RadioBoxGroup``. /// that are used within a ``RadioBoxGroup``.
@objcMembers @objcMembers
@objc(VDSRadioBoxItem) @objc(VDSRadioBoxItem)
open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable { open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable, ParentViewProtocol {
public var children: [any ViewProtocol] { [textLabel, subTextLabel, subTextRightLabel, selectorView] }
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializers // MARK: - Initializers

View File

@ -9,6 +9,10 @@ import Foundation
import UIKit import UIKit
import Combine import Combine
public protocol ParentViewProtocol {
var children: [any ViewProtocol] { get }
}
public protocol ViewProtocol: AnyObject, Initable, Resettable, Enabling, Surfaceable, AccessibilityUpdatable { public protocol ViewProtocol: AnyObject, Initable, Resettable, Enabling, Surfaceable, AccessibilityUpdatable {
/// Set of Subscribers for any Publishers for this Control. /// Set of Subscribers for any Publishers for this Control.
var subscribers: Set<AnyCancellable> { get set } var subscribers: Set<AnyCancellable> { get set }
@ -38,8 +42,15 @@ extension ViewProtocol {
public func setNeedsUpdate() { public func setNeedsUpdate() {
if shouldUpdateView { if shouldUpdateView {
shouldUpdateView = false shouldUpdateView = false
//let parent = self as? ParentViewProtocol
//parent?.children.forEach{ $0.shouldUpdateView = false }
updateView() updateView()
updateAccessibility() updateAccessibility()
// parent?.children.forEach{
// $0.updateView()
// $0.updateAccessibility()
// $0.shouldUpdateView = true
// }
shouldUpdateView = true shouldUpdateView = true
} }
} }