refactored into extension

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-08-26 14:20:07 -05:00
parent 8f319e3b11
commit d6a2ebaf95
4 changed files with 4 additions and 3 deletions

View File

@ -17,6 +17,10 @@ public protocol BinaryColorable{
var userTrueColor: Bool { get } var userTrueColor: Bool { get }
} }
extension BinaryColorable where Self: Selectable {
public var userTrueColor: Bool { return selected }
}
/// Meant to be used in a Object that implements the following interfaces for 2 possible color combinations /// Meant to be used in a Object that implements the following interfaces for 2 possible color combinations
/// - Surfaceable (var surface: Surface) /// - Surfaceable (var surface: Surface)
/// ///

View File

@ -16,7 +16,6 @@ public protocol CheckboxModel: Modelable, FormFieldable, Errorable, DataTrackabl
} }
extension CheckboxModel { extension CheckboxModel {
public var userTrueColor: Bool { return selected }
public var shouldShowError: Bool { public var shouldShowError: Bool {
guard hasError && !disabled && errorText?.isEmpty == false else { return false } guard hasError && !disabled && errorText?.isEmpty == false else { return false }

View File

@ -19,7 +19,6 @@ public protocol RadioBoxModel: Modelable, FormFieldable, Errorable, DataTrackabl
} }
extension RadioBoxModel { extension RadioBoxModel {
public var userTrueColor: Bool { return selected }
public var shouldShowError: Bool { public var shouldShowError: Bool {
guard hasError && !disabled && errorText?.isEmpty == false else { return false } guard hasError && !disabled && errorText?.isEmpty == false else { return false }

View File

@ -16,7 +16,6 @@ public protocol RadioButtonModel: Modelable, FormFieldable, Errorable, DataTrack
} }
extension RadioButtonModel { extension RadioButtonModel {
public var userTrueColor: Bool { return selected }
public var shouldShowError: Bool { public var shouldShowError: Bool {
guard hasError && !disabled && errorText?.isEmpty == false else { return false } guard hasError && !disabled && errorText?.isEmpty == false else { return false }