danielsaidi/QuickSearch
Type into a searchable SwiftUI text field without first having to focus on it.
Installation
QuickSearch can be installed with the Swift Package Manager:
https://github.com/danielsaidi/QuickSearch.gitGetting Started
All you have to do to make QuickSearch work, is to apply quickSearch: true to .searchable:
struct ContentView: View {
@State var query = ""
@State var text = ""
@FocusState var isTextFieldFocused
var body: some View {
NavigationStack {
VStack {
TextField("Type here...", text: $text)
}
.searchable(text: $query, quickSearch: true)
}
}
}You can also apply the .quickSearch view modifier, to any superview, if you can't access .searchable, use custom focus bindings, etc.
Documentation
The online [documentation][Documentation] has more information, articles, code examples, etc.
Demo Application
The Demo folder has an app that lets you try the library on macOS and on iPads with a hardware keyboard.
Support My Work
You can [become a sponsor][Sponsors] to help me dedicate more time on my various [open-source tools][OpenSource]. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.
Contact
Feel free to reach out if you have questions or want to contribute in any way:
- Website: [danielsaidi.com][Website]
- E-mail: [daniel.saidi@gmail.com][Email]
- Bluesky: [@danielsaidi@bsky.social][Bluesky]
- Mastodon: [@danielsaidi@mastodon.social][Mastodon]
License
QuickSearch is available under the MIT license. See the [LICENSE][License] file for more info.
[Email]: mailto:daniel.saidi@gmail.com [Website]: https://danielsaidi.com [GitHub]: https://github.com/danielsaidi [OpenSource]: https://danielsaidi.com/opensource [Sponsors]: https://github.com/sponsors/danielsaidi
[Bluesky]: https://bsky.app/profile/danielsaidi.bsky.social [Mastodon]: https://mastodon.social/@danielsaidi [Twitter]: https://twitter.com/danielsaidi
[Documentation]: https://danielsaidi.github.io/QuickSearch [Getting-Started]: https://danielsaidi.github.io/QuickSearch/documentation/quicksearch/getting-started [License]: https://github.com/danielsaidi/QuickSearch/blob/master/LICENSE
Package Metadata
Repository: danielsaidi/QuickSearch
Homepage: https://danielsaidi.com/opensource
Stars: 38
Forks: 0
Open issues: 0
Default branch: main
Primary language: shell
License: MIT
Topics: ios, macos, swift, swiftui, visionos
README: README.md