on-internet
← Community

Select all text in TextField upon click SwiftUI

Stack Overflow ·

How do I select all text when clicking inside a textfield? Just like how a web browser like Chrome would when you click inside the address bar. import SwiftUI import AppKit struct ContentView: View { var body: some View { TextField("Enter a URL", text: $site) } }

Comments

Sign in or sign up to comment and upvote.

No comments yet.