added Modelable
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
4a83c733e2
commit
df82f85724
@ -58,6 +58,8 @@
|
|||||||
EAF7F0B5289C126F00B287F5 /* UILabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B4289C126F00B287F5 /* UILabel.swift */; };
|
EAF7F0B5289C126F00B287F5 /* UILabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B4289C126F00B287F5 /* UILabel.swift */; };
|
||||||
EAF7F0B7289C12A600B287F5 /* UITapGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */; };
|
EAF7F0B7289C12A600B287F5 /* UITapGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */; };
|
||||||
EAF7F0B9289C139800B287F5 /* ColorConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */; };
|
EAF7F0B9289C139800B287F5 /* ColorConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */; };
|
||||||
|
EAF7F0BB289D80ED00B287F5 /* Modelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0BA289D80ED00B287F5 /* Modelable.swift */; };
|
||||||
|
EAF7F0BD289D81B100B287F5 /* FontStyleable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0BC289D81B100B287F5 /* FontStyleable.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@ -123,6 +125,8 @@
|
|||||||
EAF7F0B4289C126F00B287F5 /* UILabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UILabel.swift; sourceTree = "<group>"; };
|
EAF7F0B4289C126F00B287F5 /* UILabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UILabel.swift; sourceTree = "<group>"; };
|
||||||
EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITapGestureRecognizer.swift; sourceTree = "<group>"; };
|
EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITapGestureRecognizer.swift; sourceTree = "<group>"; };
|
||||||
EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorConfiguration.swift; sourceTree = "<group>"; };
|
EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorConfiguration.swift; sourceTree = "<group>"; };
|
||||||
|
EAF7F0BA289D80ED00B287F5 /* Modelable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Modelable.swift; sourceTree = "<group>"; };
|
||||||
|
EAF7F0BC289D81B100B287F5 /* FontStyleable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontStyleable.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -241,9 +245,11 @@
|
|||||||
EA3361A9288B25E40071C351 /* Disabling.swift */,
|
EA3361A9288B25E40071C351 /* Disabling.swift */,
|
||||||
EAF7F0A1289AFB3900B287F5 /* Errorable.swift */,
|
EAF7F0A1289AFB3900B287F5 /* Errorable.swift */,
|
||||||
EAF7F0A7289B119400B287F5 /* Fontable.swift */,
|
EAF7F0A7289B119400B287F5 /* Fontable.swift */,
|
||||||
|
EAF7F0BC289D81B100B287F5 /* FontStyleable.swift */,
|
||||||
EA3361AE288B26310071C351 /* FormFieldable.swift */,
|
EA3361AE288B26310071C351 /* FormFieldable.swift */,
|
||||||
EA33624628931B050071C351 /* Initable.swift */,
|
EA33624628931B050071C351 /* Initable.swift */,
|
||||||
EA3362442892F9130071C351 /* Labelable.swift */,
|
EA3362442892F9130071C351 /* Labelable.swift */,
|
||||||
|
EAF7F0BA289D80ED00B287F5 /* Modelable.swift */,
|
||||||
EA3361BE288B2EA60071C351 /* ModelHandlerable.swift */,
|
EA3361BE288B2EA60071C351 /* ModelHandlerable.swift */,
|
||||||
EA3361C8289054C50071C351 /* Surfaceable.swift */,
|
EA3361C8289054C50071C351 /* Surfaceable.swift */,
|
||||||
EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */,
|
EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */,
|
||||||
@ -471,6 +477,7 @@
|
|||||||
EA3C3B4C2894823E000CA526 /* AnyProxy-PropertyWrapper.swift in Sources */,
|
EA3C3B4C2894823E000CA526 /* AnyProxy-PropertyWrapper.swift in Sources */,
|
||||||
EA3361AF288B26310071C351 /* FormFieldable.swift in Sources */,
|
EA3361AF288B26310071C351 /* FormFieldable.swift in Sources */,
|
||||||
EAF7F0A8289B119400B287F5 /* Fontable.swift in Sources */,
|
EAF7F0A8289B119400B287F5 /* Fontable.swift in Sources */,
|
||||||
|
EAF7F0BB289D80ED00B287F5 /* Modelable.swift in Sources */,
|
||||||
EAF7F09E289AAEC000B287F5 /* Constants.swift in Sources */,
|
EAF7F09E289AAEC000B287F5 /* Constants.swift in Sources */,
|
||||||
EA3361B3288B265D0071C351 /* Changable.swift in Sources */,
|
EA3361B3288B265D0071C351 /* Changable.swift in Sources */,
|
||||||
EAF7F0AB289B13FD00B287F5 /* LabelAttributeFont.swift in Sources */,
|
EAF7F0AB289B13FD00B287F5 /* LabelAttributeFont.swift in Sources */,
|
||||||
@ -483,6 +490,7 @@
|
|||||||
EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */,
|
EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */,
|
||||||
EA33623E2892EE950071C351 /* UIDevice.swift in Sources */,
|
EA33623E2892EE950071C351 /* UIDevice.swift in Sources */,
|
||||||
EA3362302891EB4A0071C351 /* Fonts.swift in Sources */,
|
EA3362302891EB4A0071C351 /* Fonts.swift in Sources */,
|
||||||
|
EAF7F0BD289D81B100B287F5 /* FontStyleable.swift in Sources */,
|
||||||
EAF7F0AD289B142900B287F5 /* LabelAttributeStrikeThrough.swift in Sources */,
|
EAF7F0AD289B142900B287F5 /* LabelAttributeStrikeThrough.swift in Sources */,
|
||||||
EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */,
|
EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */,
|
||||||
EA3361BF288B2EA60071C351 /* ModelHandlerable.swift in Sources */,
|
EA3361BF288B2EA60071C351 /* ModelHandlerable.swift in Sources */,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
|
|
||||||
open class Control<ModelType: Initable>: UIControl, ModelHandlerable, ViewProtocol, Resettable {
|
open class Control<ModelType: Modelable>: UIControl, ModelHandlerable, ViewProtocol, Resettable {
|
||||||
|
|
||||||
@Published public var model: ModelType
|
@Published public var model: ModelType
|
||||||
private var cancellable: AnyCancellable?
|
private var cancellable: AnyCancellable?
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
|
|
||||||
open class View<ModelType: Initable>: UIView, ModelHandlerable, ViewProtocol, Resettable {
|
open class View<ModelType: Modelable>: UIView, ModelHandlerable, ViewProtocol, Resettable {
|
||||||
|
|
||||||
@Published public var model: ModelType
|
@Published public var model: ModelType
|
||||||
private var cancellable: AnyCancellable?
|
private var cancellable: AnyCancellable?
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public protocol CheckboxModel: FormFieldable, Errorable, DataTrackable, Accessable, Surfaceable, Disabling, Initable, BinaryColorable {
|
public protocol CheckboxModel: Modelable, FormFieldable, Errorable, DataTrackable, Accessable, BinaryColorable {
|
||||||
var id: String? { get set }
|
var id: String? { get set }
|
||||||
var on: Bool { get set }
|
var on: Bool { get set }
|
||||||
var labelText: String? { get set }
|
var labelText: String? { get set }
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public protocol LabelModel: Labelable, Surfaceable, Disabling, Initable {
|
public protocol LabelModel: Modelable, Labelable {
|
||||||
var text: String? { get set }
|
var text: String? { get set }
|
||||||
var attributes: [LabelAttributeModel]? { get set }
|
var attributes: [LabelAttributeModel]? { get set }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public protocol ToggleModel: FormFieldable, DataTrackable, Accessable, Initable, Labelable, Surfaceable, Disabling, BinaryColorable {
|
public protocol ToggleModel: Modelable, FormFieldable, DataTrackable, Accessable, Labelable, BinaryColorable {
|
||||||
var id: String? { get set }
|
var id: String? { get set }
|
||||||
var showText: Bool { get set }
|
var showText: Bool { get set }
|
||||||
var on: Bool { get set }
|
var on: Bool { get set }
|
||||||
|
|||||||
12
VDS/Protocols/FontStyleable.swift
Normal file
12
VDS/Protocols/FontStyleable.swift
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// FontStyleable.swift
|
||||||
|
// VDS
|
||||||
|
//
|
||||||
|
// Created by Matt Bruce on 8/5/22.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
public protocol FontStyleable {
|
||||||
|
var fontStyle: FontStyle { get set }
|
||||||
|
}
|
||||||
@ -16,11 +16,11 @@ public protocol Fontable {
|
|||||||
|
|
||||||
extension Fontable {
|
extension Fontable {
|
||||||
|
|
||||||
var style: FontStyle? {
|
var fontStyle: FontStyle? {
|
||||||
return try? FontStyle.style(for: fontCategory, fontWeight: fontWeight, fontSize: fontSize)
|
return try? FontStyle.style(for: fontCategory, fontWeight: fontWeight, fontSize: fontSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
var font: UIFont? {
|
var font: UIFont? {
|
||||||
return self.style?.font
|
return fontStyle?.font
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public protocol ModelHandlerable {
|
public protocol ModelHandlerable {
|
||||||
associatedtype ModelType
|
associatedtype ModelType: Modelable
|
||||||
var model: ModelType { get set }
|
var model: ModelType { get set }
|
||||||
init(with model: ModelType)
|
init(with model: ModelType)
|
||||||
func set(with model: ModelType)
|
func set(with model: ModelType)
|
||||||
|
|||||||
12
VDS/Protocols/Modelable.swift
Normal file
12
VDS/Protocols/Modelable.swift
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// Modelable.swift
|
||||||
|
// VDS
|
||||||
|
//
|
||||||
|
// Created by Matt Bruce on 8/5/22.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
public protocol Modelable: Surfaceable, Disabling, Initable {
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user