SymbolPicker Skill
Overview
This skill provides expert guidance on SymbolPicker, a native, customizable SwiftUI component for selecting SF Symbols on iOS, iPadOS, macOS, and visionOS. It mimics Apple’s native interface while offering extensive customization for colors, styles (filled/outlined), and behavior.
Agent Behavior (Follow These Rules)
- Identify Platform Targets: SymbolPicker adapts to each platform (sheet on iOS, popover on iPad/Mac/visionOS). Always verify the target platform.
- Prioritize Modifiers: Direct users to the relevant
SymbolPicker modifiers (e.g., .symbolPickerSymbolsStyle, .symbolPickerDismiss) for customization.
- Handle Colors Correctly: When discussing color selection, clarify if the user wants to use
[Double] (RGBA), SwiftUI Color, or SymbolColor.
- Emphasize Accessibility: Highlight that SymbolPicker supports VoiceOver and Dynamic Type out of the box.
- Contextual Examples: Provide concise code snippets showing the
.symbolPicker modifier applied to a view (usually a Button or Image), with bindings for presentation and selection.
- Cross-Platform Consistency: Remind users that the API is unified across platforms.
Project Settings
- Deployment Targets: iOS 14.0+, iPadOS 14.0+, macOS 11.0+, visionOS 1.0+.
- Swift Version: Swift 5.9+.
- Xcode: Xcode 15.0+.
Quick Decision Tree
Setting up a basic symbol picker?
- Basic installation and concepts →
references/SymbolPicker.md
- To apply the modifier to a view →
references/SymbolPickerView.md
Picking symbols with color?
- To use different color binding types →
references/SymbolPickerView.md
- To understand the
SymbolColor model → references/SymbolColor.md
Customizing appearance or behavior?
- Switching between filled/outlined icons →
references/SymbolPickerModifiers.md (.symbolPickerSymbolsStyle)
- Controlling dismissal behavior →
references/SymbolPickerModifiers.md (.symbolPickerDismiss)
Triage-First Playbook
- "The picker isn't showing up."
- Check if
.symbolPicker(isPresented: ...) is attached to a view that is part of the hierarchy.
- Ensure the
isPresented binding is being toggled true.
- "I want filled icons instead of outlines."
- Use
.symbolPickerSymbolsStyle(.filled).
- "How do I close the picker immediately after selecting a symbol?"
- Use
.symbolPickerDismiss(type: .onSymbolSelect).
Core Patterns Reference
Basic Usage
@State private var isPresented = false
@State private var icon = "star"
Button("Pick Icon") { isPresented = true }
.symbolPicker(isPresented: $isPresented, symbolName: $icon)
With Color Selection
@State private var isPresented = false
@State private var icon = "star.fill"
@State private var color: Color = .red
Button("Pick Icon & Color") { isPresented = true }
.symbolPicker(isPresented: $isPresented, symbolName: $icon, color: $color)
.symbolPickerSymbolsStyle(.filled)
.symbolPickerDismiss(type: .onSymbolSelect)
Integration Quick Guide
- Add Package Dependency:
https://github.com/SzpakKamil/SymbolPicker.git (Min version 1.0.0).
- Import:
import SymbolPicker.
- Requirements: iOS 14.0+, macOS 11.0+, visionOS 1.0+.
Reference Files
Load these files as needed for specific topics:
SymbolPicker.md - General overview, setup, and core benefits.
SymbolPickerView.md - Detailed information on the picker view and its initializers.
SymbolPickerModifiers.md - Customization of style (filled/outlined) and dismissal behavior.
SymbolColor.md - Guide to using the SymbolColor enum and color bindings.
SetUp.md - Step-by-step installation instructions.
1---2name: symbolpicker3description: Expert guidance on SymbolPicker, a native SwiftUI SF Symbol picker. Use when developers mention: (1) SymbolPicker, (2) selecting SF Symbols, (3) picking symbols with colors, (4) customizing symbol picker appearance, (5) cross-platform symbol selection (iOS, macOS, visionOS), (6) specific modifiers like .symbolPickerSymbolsStyle or .symbolPickerDismiss.4---5# SymbolPicker Skill67## Overview89This skill provides expert guidance on `SymbolPicker`, a native, customizable SwiftUI component for selecting SF Symbols on iOS, iPadOS, macOS, and visionOS. It mimics Apple’s native interface while offering extensive customization for colors, styles (filled/outlined), and behavior.1011## Agent Behavior (Follow These Rules)12131. **Identify Platform Targets:** SymbolPicker adapts to each platform (sheet on iOS, popover on iPad/Mac/visionOS). Always verify the target platform.142. **Prioritize Modifiers:** Direct users to the relevant `SymbolPicker` modifiers (e.g., `.symbolPickerSymbolsStyle`, `.symbolPickerDismiss`) for customization.153. **Handle Colors Correctly:** When discussing color selection, clarify if the user wants to use `[Double]` (RGBA), SwiftUI `Color`, or `SymbolColor`.164. **Emphasize Accessibility:** Highlight that SymbolPicker supports VoiceOver and Dynamic Type out of the box.175. **Contextual Examples:** Provide concise code snippets showing the `.symbolPicker` modifier applied to a view (usually a Button or Image), with bindings for presentation and selection.186. **Cross-Platform Consistency:** Remind users that the API is unified across platforms.1920## Project Settings2122- **Deployment Targets:** iOS 14.0+, iPadOS 14.0+, macOS 11.0+, visionOS 1.0+.23- **Swift Version:** Swift 5.9+.24- **Xcode:** Xcode 15.0+.2526## Quick Decision Tree27281. **Setting up a basic symbol picker?**29 * Basic installation and concepts → `references/SymbolPicker.md`30 * To apply the modifier to a view → `references/SymbolPickerView.md`31322. **Picking symbols with color?**33 * To use different color binding types → `references/SymbolPickerView.md`34 * To understand the `SymbolColor` model → `references/SymbolColor.md`35363. **Customizing appearance or behavior?**37 * Switching between filled/outlined icons → `references/SymbolPickerModifiers.md` (`.symbolPickerSymbolsStyle`)38 * Controlling dismissal behavior → `references/SymbolPickerModifiers.md` (`.symbolPickerDismiss`)3940## Triage-First Playbook4142- **"The picker isn't showing up."**43 * Check if `.symbolPicker(isPresented: ...)` is attached to a view that is part of the hierarchy.44 * Ensure the `isPresented` binding is being toggled true.45- **"I want filled icons instead of outlines."**46 * Use `.symbolPickerSymbolsStyle(.filled)`.47- **"How do I close the picker immediately after selecting a symbol?"**48 * Use `.symbolPickerDismiss(type: .onSymbolSelect)`.4950## Core Patterns Reference5152### Basic Usage53```swift54@State private var isPresented = false55@State private var icon = "star"5657Button("Pick Icon") { isPresented = true }58 .symbolPicker(isPresented: $isPresented, symbolName: $icon)59```6061### With Color Selection62```swift63@State private var isPresented = false64@State private var icon = "star.fill"65@State private var color: Color = .red6667Button("Pick Icon & Color") { isPresented = true }68 .symbolPicker(isPresented: $isPresented, symbolName: $icon, color: $color)69 .symbolPickerSymbolsStyle(.filled)70 .symbolPickerDismiss(type: .onSymbolSelect)71```7273## Integration Quick Guide74751. **Add Package Dependency**: `https://github.com/SzpakKamil/SymbolPicker.git` (Min version 1.0.0).762. **Import**: `import SymbolPicker`.773. **Requirements**: iOS 14.0+, macOS 11.0+, visionOS 1.0+.7879## Reference Files8081Load these files as needed for specific topics:8283- **`SymbolPicker.md`** - General overview, setup, and core benefits.84- **`SymbolPickerView.md`** - Detailed information on the picker view and its initializers.85- **`SymbolPickerModifiers.md`** - Customization of style (filled/outlined) and dismissal behavior.86- **`SymbolColor.md`** - Guide to using the `SymbolColor` enum and color bindings.87- **`SetUp.md`** - Step-by-step installation instructions.