File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Sources/ValidatorUI/Classes/SUI/Managers/FormField/FormFieldManager Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,9 @@ import ValidatorCore
1010public final class FormFieldManager : IFormFieldManager {
1111 // MARK: Properties
1212
13- @Published public var isValid = true
13+ @Published public var isValid = false
1414
15+ private var cancellables = Set < AnyCancellable > ( )
1516 private var validators : [ any IFormValidationContainer ] = [ ]
1617
1718 // MARK: Initialization
@@ -21,6 +22,14 @@ public final class FormFieldManager: IFormFieldManager {
2122 // MARK: IFormFieldManager
2223
2324 public func append( validator: some IFormValidationContainer ) {
25+ validator
26+ . publisher
27+ . sink ( receiveValue: { [ weak self] _ in
28+ self ? . validate ( )
29+ }
30+ )
31+ . store ( in: & cancellables)
32+
2433 validators. append ( validator)
2534 validate ( )
2635 }
You can’t perform that action at this time.
0 commit comments