← 返回
开发者工具 中文

SymbolPicker

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.
SymbolPicker(原生 SwiftUI SF Symbol 选择器)的专家指导。适用于开发者提及以下场景:(1) SymbolPicker,(2) 选择 SF Symbols,(3) 选取带颜色的符号,(4) 自定义选择器外观,(5) 跨平台符号选择(iOS、macOS、visionOS),(6) 特定修饰符(如 .symbolPickerSymbolsStyle 或 .symbolPickerDismiss)。
szpakkamil
开发者工具 clawhub v1.0.0 1 版本 99661.3 Key: 无需
★ 1
Stars
📥 2,040
下载
💾 30
安装
1
版本
#latest

概述

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)

  1. Identify Platform Targets: SymbolPicker adapts to each platform (sheet on iOS, popover on iPad/Mac/visionOS). Always verify the target platform.
  2. Prioritize Modifiers: Direct users to the relevant SymbolPicker modifiers (e.g., .symbolPickerSymbolsStyle, .symbolPickerDismiss) for customization.
  3. Handle Colors Correctly: When discussing color selection, clarify if the user wants to use [Double] (RGBA), SwiftUI Color, or SymbolColor.
  4. Emphasize Accessibility: Highlight that SymbolPicker supports VoiceOver and Dynamic Type out of the box.
  5. 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.
  6. 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

  1. Setting up a basic symbol picker?
    • Basic installation and concepts → references/SymbolPicker.md
    • To apply the modifier to a view → references/SymbolPickerView.md
  1. Picking symbols with color?
    • To use different color binding types → references/SymbolPickerView.md
    • To understand the SymbolColor model → references/SymbolColor.md
  1. 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

  1. Add Package Dependency: https://github.com/SzpakKamil/SymbolPicker.git (Min version 1.0.0).
  2. Import: import SymbolPicker.
  3. 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 个版本

  • v1.0.0 当前
    2026-03-28 17:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

ColorKit

szpakkamil
针对 ColorKit(一个用于高级颜色处理、转换及无障碍管理的 Swift 库)提供专家指导。适用于开发者提及以下内容时:(1) CKColor、CKBlendMode、CKAPCA,(2) 色彩空间转换(OKLAB、Display P3
★ 0 📥 1,524
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,758
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,933