Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 10 Oct 18:09
· 2 commits to main since this release

Upgrade v1 to v2

import SearchField

struct ContentView: View {
    @State private var searchText = ""
    var body: some View {
-        SearchField(searchText, textFieldChanged: { value in
+        SearchField(searchText: $searchText, placeholder: "Search...") { text in
-            print("value\(value)")
-            searchText = value
+            print("Search text changed to: \(text)")
+        })
-        }
        Text(searchText)
    }
}
import SwiftUI
import SearchField

struct ContentView: View {
    @State private var searchText = ""

    var body: some View {
        SearchField(searchText: $searchText, placeholder: "Search...", searchField:  { text in
            print("Search text changed to: \(text)")
        })
    }
}