Sleek searchbar for iOS and macOS
- Focus triggers callback and receeded look and feel
- Text change triggers callback
- Customizable sizing and color theme (via struct injection)
- Works for iOS and macOS
- Dark / light mode
SearchBar(
placeholderText: "Search...", // Placeholder text
onFocus: { // Triggered when searchfield is focused
Swift.print("isFocused: \($0)")
}, onTextChange: { // Triggered when text changes
Swift.print("text: \($0)")
}
)
Add to your project using Swift Package Manager by adding the following URL:
.package(url: "https://github.com/sentryco/SearchBarKit", branch: "main")
- Maybe not hide close button on focus loss?
- Add more comments with AI
- Remove unit test, add uitest
- It seems placeholder text-color for SearchBar text doesnt work for macOS. Try to fix it
- Add SearchBarIdentifier (injectable accessid) (for now these are hardcoded)
- Move more metrics to const (later when it makes sense)