📌  相关文章
📜  检测文本字段更改 swiftui - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:58.344000             🧑  作者: Mango

代码示例1
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)
            }
    }
}