applied UserInfoable to views/controls

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-01-23 09:26:41 -06:00
parent d6071686a2
commit dd311fc920
4 changed files with 12 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import UIKit
import Combine import Combine
@objc(VDSControl) @objc(VDSControl)
open class Control: UIControl, Handlerable, ViewProtocol, Resettable { open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoable {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Combine Properties // MARK: - Combine Properties
@ -23,6 +23,8 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable {
//-------------------------------------------------- //--------------------------------------------------
private var initialSetupPerformed = false private var initialSetupPerformed = false
open var userInfo = [String: Primitive]()
open var surface: Surface = .light { didSet { didChange() } } open var surface: Surface = .light { didSet { didChange() } }
open var disabled: Bool = false { didSet { isEnabled = !disabled } } open var disabled: Bool = false { didSet { isEnabled = !disabled } }

View File

@ -11,7 +11,7 @@ import Combine
@objc(VDSView) @objc(VDSView)
open class View: UIView, Handlerable, ViewProtocol, Resettable { open class View: UIView, Handlerable, ViewProtocol, Resettable, UserInfoable {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Combine Properties // MARK: - Combine Properties
@ -24,6 +24,8 @@ open class View: UIView, Handlerable, ViewProtocol, Resettable {
//-------------------------------------------------- //--------------------------------------------------
private var initialSetupPerformed = false private var initialSetupPerformed = false
open var userInfo = [String: Primitive]()
open var surface: Surface = .light { didSet { didChange() }} open var surface: Surface = .light { didSet { didChange() }}
open var disabled: Bool = false { didSet { isEnabled = !disabled } } open var disabled: Bool = false { didSet { isEnabled = !disabled } }

View File

@ -18,7 +18,7 @@ public protocol Buttonable: UIControl, Surfaceable, Disabling {
} }
@objc(VDSButtonBase) @objc(VDSButtonBase)
open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettable { open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettable, UserInfoable {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Configuration Properties // MARK: - Configuration Properties
//-------------------------------------------------- //--------------------------------------------------
@ -48,6 +48,8 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
open var disabled: Bool = false { didSet { isEnabled = !disabled } } open var disabled: Bool = false { didSet { isEnabled = !disabled } }
open var userInfo = [String: Primitive]()
var isHighlightAnimating = false var isHighlightAnimating = false
open override var isHighlighted: Bool { open override var isHighlighted: Bool {
didSet { didSet {

View File

@ -11,7 +11,7 @@ import VDSColorTokens
import Combine import Combine
@objc(VDSLabel) @objc(VDSLabel)
public class Label: UILabel, Handlerable, ViewProtocol, Resettable { public class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Combine Properties // MARK: - Combine Properties
@ -37,6 +37,8 @@ public class Label: UILabel, Handlerable, ViewProtocol, Resettable {
open var textPosition: TextPosition = .left { didSet { didChange() }} open var textPosition: TextPosition = .left { didSet { didChange() }}
open var userInfo = [String: Primitive]()
open override var isEnabled: Bool { open override var isEnabled: Bool {
get { !disabled } get { !disabled }
set { set {