Add this to your SwiftUI view and all your TextField in that view will start displaying clear button
init() {
UITextField.appearance().clearButtonMode = .whileEditing
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: