commented code

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-07-26 10:23:38 -05:00
parent cd88205b40
commit 16e8067f8e
3 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,8 @@ public protocol EnumSubset<T>: RawRepresentable, CaseIterable {
} }
extension EnumSubset where RawValue == T.RawValue { extension EnumSubset where RawValue == T.RawValue {
/// Will either return the Generic RawRepresentable object or the defaultValue
public var value: T { public var value: T {
T(rawValue: rawValue) ?? defaultValue T(rawValue: rawValue) ?? defaultValue
} }

View File

@ -7,7 +7,12 @@
import Foundation import Foundation
/// Protocol used for objects that require to show an error
public protocol Errorable { public protocol Errorable {
/// Whether not to show the errorText
var showError: Bool { get set } var showError: Bool { get set }
/// Text that needs to be shown if showError is true
var errorText: String? { get set } var errorText: String? { get set }
} }

View File

@ -7,7 +7,12 @@
import Foundation import Foundation
/// Protocol used for a FormField object
public protocol FormFieldable { public protocol FormFieldable {
/// Unique Id for the Form Field object within a Form
var inputId: String? { get set } var inputId: String? { get set }
/// Value for the Form Field
var value: AnyHashable? { get set } var value: AnyHashable? { get set }
} }