跳到正文
TakoAPI
返回技能列表

symbolpicker

由 szpakkamil 提供

iOS & macOS Development
1.5k下载量由 clawskills.sh 提供
1星标
2浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Expert guidance on SymbolPicker, a native SwiftUI SF Symbol.

描述

该技能的功能

SymbolPicker is a SwiftUI component for selecting SF Symbols on iOS, iPadOS, macOS, and visionOS. It mimics Apple's native picker interface and supports color binding, filled or outlined icon styles, and configurable dismissal behavior.

It replicates Apple's native SF Symbol picker UI, including search and color selection, without requiring developers to implement the sheet, bindings, and icon grid from scratch.

何时使用

  • Letting users choose an icon for a custom task category
  • Selecting a symbol and color for a habit tracker entry
  • Picking shortcut icons in a launcher or home screen app
  • Customizing icons for bookmarks or saved notes
  • Building a symbol browser inside a SwiftUI design tool

示例工作流

输入

User asks: How do I add a symbol picker with color selection to a SwiftUI button?

智能体
  1. 1

    Add the SymbolPicker package from GitHub via Swift Package Manager (min version 1.0.0)

  2. 2

    Import SymbolPicker in the SwiftUI file

  3. 3

    Declare @State variables for isPresented, symbolName (String), and color (Color)

  4. 4

    Attach .symbolPicker(isPresented:symbolName:color:) to a Button

  5. 5

    Apply .symbolPickerSymbolsStyle(.filled) and .symbolPickerDismiss(type: .onSymbolSelect) as needed

输出

A Button that opens a native-style symbol picker sheet with color selection, displaying filled icons and closing automatically after the user selects a symbol

前置要求

  • SymbolPicker Swift package added via Swift Package Manager (https://github.com/SzpakKamil/SymbolPicker.git, minimum version 1.0.0)

安装

clawhub install szpakkamil/symbolpicker

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接