Skip to content

Releases

PickableItems 1.1.0 — External & Async Autocomplete

Choose a tag to compare

@ata-tr53 ata-tr53 released this 25 Nov 14:56

PickableItems 1.1.0

This minor release adds support for external and async autocomplete sources (such as server-backed tag search APIs) while remaining 100% backwards-compatible with 1.0.0.

What's New

  • Async searchProvider initializer: Pass a (String) async throws -> [Item] closure to KeyboardPickableItemCoordinator when your data source already handles filtering and sorting. PickableItems automatically debounces keystrokes, cancels stale in-flight requests, preserves your provider's result ordering, and filters out selected items.
  • Loading & error state: Observe coordinator.isLoading (for example, to show a ProgressView in a trailing accessory) and coordinator.searchError for non-cancellation errors.
  • Configurable debounceDuration: Customize the search debounce delay on both local and remote coordinators (defaults to 300ms).
  • Smarter selection updates: Selecting or deselecting items in remote mode re-filters the cached results without triggering redundant network calls.

Example

@State private var coordinator = KeyboardPickableItemCoordinator<RemoteTag>(
    debounceDuration: .milliseconds(300)
) { query in
    guard query.count >= 2 else { return [] }
    return try await apiClient.autocompleteTags(matching: query)
}

PickableItems 1.0.0 - Initial Release

Choose a tag to compare

@ata-tr53 ata-tr53 released this 25 Nov 14:13

PickableItems 1.0.0

Initial release of PickableItems — a lightweight SwiftUI package that adds a searchable, fuzzy-matched keyboard accessory bar for picking tags, categories, assignees, or any custom model right above the keyboard.

Highlights

  • Type-scoped SwiftUI modifiers: Use keyboardItemPickerContainer and keyboardItemPickerFocusBridge to attach multiple independent pickers to the same Form or View.
  • Smart search & ranking: Combines substring matching, length-scaled Levenshtein fuzzy search, alias matching (secondaryNames), and usage frequency (useAmount).
  • Configurable sorting strategies: Choose between .mixed(penaltyMultiplier:), .pureUseAmount, and .pureDistance.
  • Customizable accessories & ergonomics: Supports optional leading and trailing accessory views, clearOnSelect, and an onSelect callback.
  • Modern SwiftUI & Swift 6: Built with @Observable, @MainActor isolation, and adaptive .safeAreaBar / .glassProminent support on OS 26+ with automatic fallbacks.

Requirements

  • iOS 18.0+ / macOS 14.0+ / watchOS 10.0+ / tvOS 17.0+
  • Swift 6.4+