Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

detect textfield change 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)
            }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #detect #textfield #change #swiftui
ADD COMMENT
Topic
Name
9+3 =