Interactive previews iPhone
TextFieldLink
A control that requests text input from the user when pressed
Platform Compatibility
watchOS 9.0+
Tags
SwiftUI Code
TextFieldLink("Set Text", prompt: Text("Custom Placeholder")) { str in
print("Typed text: \(str)")
}Found an issue or have a suggestion?
Created: June 5, 2025Updated: December 27, 2025
More Link Components
View allCustom Preview Item ShareLink
Creates an instance, with a custom label, that presents the share interface
Explore Other Components
Browse allStepped Slider
Creates a slider to select a value from a given range, subject to a step increment