func onSubmit (of: SubmitTriggers , (() -> Void)) -> some View
Adds an action to perform when the user submits a value to this view.
func submitLabel (SubmitLabel ) -> some View
Sets the submit label for this view.
Availability 有効性
Technology
isBlocking
A Boolean that indicates whether this scope is actively blocking submission triggers from reaching higher submission actions.
Use this modifier when you want to avoid specific views from initiating a submission action configured by the on
modifier. In the example below, the tag field doesn’t trigger the submission of the form:
Form {
TextField("Username", text: $viewModel.userName)
SecureField("Password", text: $viewModel.password)
TextField("Tags", text: $viewModel.tags)
.submitScope()
}
.onSubmit {
guard viewModel.validate() else { return }
viewModel.login()
}
func onSubmit (of: SubmitTriggers , (() -> Void)) -> some View
func submitLabel (SubmitLabel ) -> some View