text
TypeScriptget text(): SubmitTriggersSwift declarationstatic let text: SubmitTriggersDefines triggers originating from text input controls like `TextField` and `SecureField`.
struct · iOS 15.0+ · SDK 27.1
struct SubmitTriggersA type that defines various triggers that result in the firing of a submission action. These triggers may be provided to the ``View/onSubmit(of:_:)`` modifier to alter which types of user behaviors trigger a provided submission action.
get text(): SubmitTriggersSwift declarationstatic let text: SubmitTriggersDefines triggers originating from text input controls like `TextField` and `SecureField`.
get search(): SubmitTriggersSwift declarationstatic let search: SubmitTriggersDefines triggers originating from search fields constructed from searchable modifiers. In the example below, only the search field or search completions placed by the searchable modifier will trigger the view model to submit its current search query. @StateObject private var viewModel = ViewModel() NavigationView { SidebarView() DetailView() } .searchable( text: $viewModel.searchText, placement: .sidebar ) { SuggestionsView() } .onSubmit(of: .search) { viewModel.submitCurrentSearchQuery() }
init(rawValue: number): SubmitTriggersSwift declarationinit(rawValue: SubmitTriggers.RawValue)Creates a set of submit triggers.
getRawValue($self: SubmitTriggers): numberSwift declarationlet rawValue: SubmitTriggers.RawValueThe corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"
No declarations were skipped in this snapshot.