Answers for "swift textfield text changed"

-1

how to know when text changed textfield swiftui

import Combine
import SwiftUI

struct ContentView: View {
    @State var location: String = ""

    var body: some View {
        TextField("Search Location", text: $location)
            .onReceive(Just(location)) { location in
                // print(location)
            }
    }
}
Posted by: Guest on January-20-2021

Code answers related to "swift textfield text changed"

Code answers related to "Swift"

Browse Popular Code Answers by Language