From 6fb56aec196cfce0213a3a1ff754696653db0cc8 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 23 Aug 2022 13:28:00 -0500 Subject: [PATCH] changed associated name Signed-off-by: Matt Bruce --- .../Selector/SelectorGroupBase.swift | 8 +++---- .../Selector/SelectorGroupModel.swift | 22 +++---------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/VDS/Components/Selector/SelectorGroupBase.swift b/VDS/Components/Selector/SelectorGroupBase.swift index a0bcea69..feea9ab2 100644 --- a/VDS/Components/Selector/SelectorGroupBase.swift +++ b/VDS/Components/Selector/SelectorGroupBase.swift @@ -9,7 +9,7 @@ import Foundation import UIKit import Combine -open class SelectorGroupBase>: View, Changable where SelectorType == SelectorGroupType.SelectorType { +open class SelectorGroupBase>: View, Changable where SelectorModelType == SelectorGroupType.SelectorModelType { public var selectorViews: [SelectorHandlerType] = [] @@ -113,7 +113,7 @@ open class SelectorGroupBase SelectorType? { + public func getCachedSelector(viewModel: SelectorModelType) -> SelectorModelType? { if let index = model.selectors.firstIndex(where: { element in return element.id == viewModel.id }) { @@ -123,7 +123,7 @@ open class SelectorGroupBase: Modelable, FormFieldable, Errorable { - associatedtype SelectorType: SelectorModel - var selectors: [SelectorType] { get set } -} - -public struct DefaultSelectorGroupModel: SelectorGroupModel { - public var id: UUID = UUID() - public var inputId: String? - public var value: AnyHashable? - public var surface: Surface = .light - public var hasError: Bool = false - public var errorText: String? - public var disabled: Bool = false - public var selectedModel: SelectorType? - public var selectors: [SelectorType] - public init() { selectors = [] } - public init(selectors: [SelectorType]){ - self.selectors = selectors - } +public protocol SelectorGroupModel: Modelable, FormFieldable, Errorable { + associatedtype SelectorModelType: SelectorModel + var selectors: [SelectorModelType] { get set } }