You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// - mode: The mode in which the form will be validated. Defaults to `.onSubmit`.
20
+
/// - reValidateMode: The mode in which the form will be re-validated. Defaults to `.onChange`.
21
+
/// - resolver: A resolver used to resolve validation rules for fields. Defaults to `nil`.
22
+
/// - context: An optional context that can be used when resolving validation rules for fields. Defaults to `nil`.
23
+
/// - shouldUnregister: A boolean value that indicates whether the form should unregister its fields when it is deallocated. Defaults to `true`.
24
+
/// - shouldFocusError: A boolean value that indicates whether the form should focus on an error field when it is invalidated. Defaults to `true`.
25
+
/// - delayErrorInNanoseconds: The amount of time (in nanoseconds) that the form will wait before focusing on an error field when it is invalidated. Defaults to 0 nanoseconds (no delay).
26
+
/// - onFocusField: An action performed when a field is focused on by the user or programmatically by the form.
27
+
/// - contentBuilder: A closure used for building content for the contextual form view, using a FormControl<FieldName> instance as a parameter.
/// - mode: The mode in which the form will be validated. Defaults to `.onSubmit`.
55
+
/// - reValidateMode: The mode in which the form will be re-validated. Defaults to `.onChange`.
56
+
/// - resolver: A resolver used to resolve validation rules for fields. Defaults to `nil`.
57
+
/// - context: An optional context that can be used when resolving validation rules for fields. Defaults to `nil`.
58
+
/// - shouldUnregister: A boolean value that indicates whether the form should unregister its fields when it is deallocated. Defaults to `true`.
59
+
/// - shouldFocusError: A boolean value that indicates whether the form should focus on an error field when it is invalidated. Defaults to `true`.
60
+
/// - delayErrorInNanoseconds: The amount of time (in nanoseconds) that the form will wait before focusing on an error field when it is invalidated. Defaults to 0 nanoseconds (no delay).
61
+
/// - focusedFieldBinder: A binding used to bind a FocusState<FieldName?> instance, which holds information about which field is currently focused on by the user or programmatically by the form.
62
+
/// - contentBuilder: A closure used for building content for the contextual form view, using a FormControl<FieldName> instance as a parameter.
Copy file name to clipboardExpand all lines: Sources/FormHook/Controller.swift
+1-18Lines changed: 1 addition & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -9,23 +9,6 @@ import Foundation
9
9
import SwiftUI
10
10
import Hooks
11
11
12
-
/// A type that represents a field option.
13
-
///
14
-
/// The `FieldOption` type is used to represent a field option. It consists of a `name` and a `value` of type `Binding<Value>`. The `Binding` type is used to create two-way bindings between a view and its underlying model.
15
-
publicstructFieldOption<FieldName, Value>{
16
-
/// The name of the field option.
17
-
publicletname:FieldName
18
-
/// A binding of type `Value`.
19
-
publicletvalue:Binding<Value>
20
-
21
-
init(name:FieldName, value:Binding<Value>){
22
-
self.name = name
23
-
self.value = value
24
-
}
25
-
}
26
-
27
-
publictypealiasControllerRenderOption<FieldName, Value>=(field:FieldOption<FieldName,Value>, fieldState:FieldState, formState:FormState<FieldName>) where FieldName: Hashable
28
-
29
12
/// A convenient view that wraps a call of `useController`
/// The `FieldOption` type is used to represent a field option. It consists of a `name` and a `value` of type `Binding<Value>`. The `Binding` type is used to create two-way bindings between a view and its underlying model.
15
+
publicstructFieldOption<FieldName, Value>{
16
+
/// The name of the field option.
17
+
publicletname:FieldName
18
+
/// A binding of type `Value`.
19
+
publicletvalue:Binding<Value>
20
+
21
+
init(name:FieldName, value:Binding<Value>){
22
+
self.name = name
23
+
self.value = value
24
+
}
25
+
}
26
+
27
+
/// A tuple representing the render options for a controller.
28
+
publictypealiasControllerRenderOption<FieldName, Value>=(field:FieldOption<FieldName,Value>, fieldState:FieldState, formState:FormState<FieldName>) where FieldName: Hashable
0 commit comments