← 返回
未分类 中文

SFSymbolsKit

Use when generating, validating, or fixing Apple SFSymbol names in Swift, SwiftUI, UIKit, or AppKit. Grounds symbol usage against the real catalog (SFSymbols...
用于在 Swift、SwiftUI、UIKit 或 AppKit 中生成、验证或修复 Apple SFSymbol 名称,依据真实符号目录(SFSymbols)确保使用正确。
wikipediabrown wikipediabrown 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 268
下载
💾 0
安装
1
版本
#latest

概述

SFSymbolsKit — grounded SFSymbols for Swift

Apple's SFSymbol APIs (Image(systemName:), UIImage(systemName:),

NSImage(systemSymbolName:)) take a String. A wrong name compiles

and ships a blank icon — there is no compiler or runtime error. Models

routinely emit plausible but non-existent names. This skill makes you

ground every SFSymbol against the real catalog.

Hard rule

Never emit a raw guessed systemName: / systemSymbolName: string.

Every SFSymbol you produce must be verified against the bundled

manifest first.

The catalog

{baseDir}/symbols.json is the authoritative manifest: an object with

count, sfsymbolsVersion, and symbols: [{ "name", "property" }],

generated from SFSymbolsKit's source (the same data as

). name is the dotted system

name (square.and.arrow.up); property is the typed SFSymbolsKit

accessor (squareAndArrowUp).

Procedure

  1. Load {baseDir}/symbols.json.
  2. Resolve the symbol the user wants:
    • Exact: match their input against name (dotted) or property

(camelCase), case-insensitively, ignoring ./-/_/space.

  • Search: if they describe it ("trash", "arrow up"), filter

symbols whose name/property contains the normalized query;

prefer prefix matches; offer the top candidates.

  1. **If the requested name is not in symbols, it is not a real

SFSymbol.** Do not invent or "fix" it by guessing — choose the

closest real entry from the manifest and say so.

  1. Emit the typed SFSymbolsKit accessors for the resolved property:
    • SwiftUI: Image(systemName: String.SFSymbols.)
    • UIKit: UIImage.SFSymbols.
    • AppKit: NSImage.SFSymbols.
    • Enum: SFSymbol. (.allCases is CaseIterable)
  2. If the project doesn't depend on SFSymbolsKit yet, add it:

.package(url: "https://github.com/WikipediaBrown/SFSymbolsKit.git", from: "1.0.0")

then import SFSymbolsKit.

Name transform (for reasoning, not for guessing)

Dotted → camelCase: drop the dots, camel-case each segment

(square.and.arrow.upsquareAndArrowUp, gearshape.fill

gearshapeFill). Leading digits and Swift keywords are special-cased

in the catalog — always trust symbols.json's property, never a

transform you computed, when they could differ.

If a SFSymbolsKit MCP server is available

Prefer its tools over manual lookup: resolve_sf_symbol (validate a

candidate; returns the canonical accessors or valid:false +

suggestions), search_sf_symbols, sf_symbol_usage. Fall back to

{baseDir}/symbols.json when the MCP server is not connected.

Why

This converts the one error class you cannot self-correct (a

stringly-typed symbol that compiles but renders nothing) into a

verified, typed reference. Source & docs: .

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-21 14:44 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 328,913
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,795
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,878