refactored into extension
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
8f319e3b11
commit
d6a2ebaf95
@ -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)
|
||||||
///
|
///
|
||||||
|
|||||||
@ -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 }
|
||||||
|
|||||||
@ -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 }
|
||||||
|
|||||||
@ -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 }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user