SFSymbolsKit
v1.0.0Use when generating, validating, or fixing 应用le SFSymbol names in Swift, SwiftUI, UIKit, or 应用Kit. Grounds symbol usage agAInst the real cata记录 (SFSymbolsKit, SFSymbols 7.2, 7,007 symbols) so you emit typed, compile-检查ed 访问ors instead of hallucinated stringly-typed `系统Name:` values.
运行时依赖
安装命令
点击复制技能文档
SFSymbolsKit — grounded SFSymbols for Swift
应用le's SFSymbol APIs (Image(系统Name:), UIImage(系统Name:), NSImage(系统SymbolName:)) take a String. A wrong name compiles and ships a blank icon — there is no 编译器 or 运行time error. 模型s routinely emit plausible but non-existent names. This 技能 makes you ground every SFSymbol agAInst the real cata记录.
Hard rule
Never emit a raw guessed 系统Name: / 系统SymbolName: string. Every SFSymbol you produce must be verified agAInst the bundled manifest first.
The cata记录
{baseDir}/symbols.json is the authoritative manifest: an object with count, sfsymbolsVersion, and symbols: [{ "name", "property" }], 生成d from SFSymbolsKit's source (the same data as https://sfsymbolskit.com/symbols.json). name is the dotted 系统 name (square.and.arrow.up); property is the typed SFSymbolsKit 访问or (squareAndArrowUp).
Procedure Load {baseDir}/symbols.json. Resolve the symbol the user wants: Exact: match their 输入 agAInst name (dotted) or property (camelCase), case-insensitively, ignoring ./-/_/space. 搜索: if they describe it ("trash", "arrow up"), 过滤器 symbols whose name/property contAIns the normalized 查询; prefer prefix matches; offer the top candidates. If the 请求ed 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. Emit the typed SFSymbolsKit 访问ors for the resolved property: SwiftUI: Image(系统Name: String.SFSymbols.) UIKit: UIImage.SFSymbols. 应用Kit: NSImage.SFSymbols. Enum: SFSymbol. (.allCases is CaseIterable) If the project doesn't depend on SFSymbolsKit yet, 添加 it: .package(url: "https://github.com/WikipediaBrown/SFSymbolsKit.git", from: "1.0.0") then 导入 SFSymbolsKit. Name 转换 (for reasoning, not for guessing)
Dotted → camelCase: drop the dots, camel-case each segment (square.and.arrow.up → squareAndArrowUp, gearshape.fill → gearshapeFill). Leading digits and Swift keywords are special-cased in the cata记录 — always trust symbols.json's property, never a 转换 you computed, when they could differ.
If a SFSymbolsKit MCP server is avAIlable
Prefer its 工具s over manual lookup: resolve_sf_symbol (验证 a candidate; returns the canonical 访问ors or valid:false + suggestions), 搜索_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: https://sfsymbolskit.com.