How to change the value of a focused textfield in SwiftUI? – Ios swift
I have a focused textfield. @FocusState private var focusedField: Field? TextField("0", value: $price, format: .currency(code: "USD").locale(Locale(identifier: "en_US"))) .keyboardType(.numbersAndPunctuation) .multilineTextAlignment(.trailing) .focused($focusedField, equals: field) And a button Button("Tap") { price = 200 } However if the textfield is focused you can not…