用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill swift-liquid-glass-design-system-ios26命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | swift-liquid-glass-design-system-ios26 |
| description | >- Use when this capability is needed. |
Liquid Glass is the adaptive material Apple introduced at WWDC25 for controls and navigational
elements across iOS / iPadOS / macOS 26 and the rest of the 26 family. In SwiftUI you reach it
through two canonical entry points — the glassEffect(_:in:) view modifier and the
GlassEffectContainer view — plus a small set of variants and an id-based morph mechanism. This
skill applies it the way Apple's
Applying Liquid Glass to custom views
article and the
Landmarks sample
prescribe — not by hand-rolling .ultraThinMaterial blurs.
.ultraThinMaterial / .regularMaterial blurs imitating glass — replace
with the real glassEffect.Announce on invoke: "Using swift-liquid-glass-design-system-ios26 to apply the system glass material per Apple's custom-views guidance."
Do not reach for this when the built-in components already provide glass for free — standard
TabView, .toolbar, sheets, and NavigationStack chrome render Liquid Glass automatically on
iOS 26. Adopt the new component APIs first; use glassEffect for custom views the system
doesn't style for you.
| API | Signature (verified) | Use |
|---|---|---|
glassEffect(_:in:) | nonisolated func glassEffect(_ glass: Glass = .regular, in shape: some Shape = DefaultGlassEffectShape()) -> some View | Apply glass to a custom view, clipped to a shape |
GlassEffectContainer | GlassEffectContainer(spacing:) { … } | Group glass shapes so they can sample/morph together |
Glass | struct Glass — variants .regular (default), .clear, .identity | The material configuration |
Glass.interactive(_:) | func interactive(_ isEnabled: Bool = true) -> Glass | Make custom glass respond to tap/press |
glassEffectID(_:in:) | nonisolated func glassEffectID(_ id: (some Hashable & Sendable)?, in namespace: Namespace.ID) -> some View | Tag glass shapes so SwiftUI morphs them across transitions |
GlassButtonStyle / GlassProminentButtonStyle | .buttonStyle(.glass) / .buttonStyle(.glassProminent) | Glass on standard Buttons without manual glassEffect |
GlassEffectTransition | type | Customize the morph transition between tagged shapes |
DefaultGlassEffectShape | type | The default clip shape glassEffect uses when none given |
Note:
glassEffectIDtakes(some Hashable & Sendable)?— the id is optional and must beSendable. Passing a non-Sendableid, or forgetting the optionality, won't match Apple's signature.
Glass cannot sample other glass. Two .glassEffect() views that overlap or need to interact
must live inside a single GlassEffectContainer. Nesting glass without a shared container
produces broken, doubled visuals (a well-known iOS 26 pitfall). One container per cluster of
glass that belongs together; don't wrap your whole view tree in one giant container either.
glassEffectID(_:in:) only morphs shapes whose ids share the same Namespace.ID and
live in the same GlassEffectContainer. Source and destination across different containers
or namespaces will not animate into each other — they'll cross-fade or pop.
.clear is opt-in legibility riskGlass.regular is legible by default. Glass.clear is more transparent and, per Apple HIG,
needs an explicit contrast strategy (a dimming layer, a shadow, or content-aware tinting) on
busy backgrounds. Default to .regular; reach for .clear only when you control what's behind it.
Every API here is iOS 26.0+ (and the 26-family equivalents). There is no shim for iOS 17/18/25. Guard and provide a non-glass fallback:
if #available(iOS 26, *) {
content.glassEffect(.regular, in: .capsule)
} else {
content.background(.regularMaterial, in: .capsule) // graceful pre-26 fallback
}
Liquid Glass must respect the system settings. Honor:
glassEffectID morphs.Maintain WCAG 4.5:1 contrast for text over glass. Read these via @Environment
(accessibilityReduceTransparency, accessibilityReduceMotion, colorSchemeContrast).
A toolbar of two buttons that share a container so they morph and don't double-sample. Verified against the signatures above:
struct GlassToolbar: View {
@Namespace private var glassNS
@Environment(\.accessibilityReduceTransparency) private var reduceTransparency
var body: some View {
GlassEffectContainer(spacing: 12) {
HStack(spacing: 12) {
Button("Save") {}
.glassEffect(reduceTransparency ? .identity : .regular.interactive(),
in: .capsule)
.glassEffectID("save", in: glassNS)
Button("Cancel") {}
.glassEffect(reduceTransparency ? .identity : .regular,
in: .capsule)
.glassEffectID("cancel", in: glassNS)
}
.padding()
}
}
}
For standard buttons that don't need custom shapes, prefer the style instead of manual glass:
Button("Continue") {}.buttonStyle(.glassProminent) // GlassProminentButtonStyle
.scrollEdgeEffectStyle(_:for:) rather than stacking your own glass at the edge.If the codebase fakes glass with .ultraThinMaterial + custom shadows:
.glassEffect(.regular, in: <shape>) inside a
GlassEffectContainer.#available fallback (rule 4).global-skills/apple/apple-anti-patterns/SKILL.md — registers the "no glass on glass" and
"wrap an Apple-canonical API in a hand-rolled struct" anti-patterns this skill avoids.global-skills/meta/skill-pattern-freshness-audit/SKILL.md — re-verifies these glass APIs
after each WWDC, since the material's API surface evolved through the iOS 26 beta cycle.Last verified: 2026-06-03 against Apple Developer docs (glassEffect / Glass / glassEffectID
signatures confirmed live, iOS 26.0+) + WWDC25 #323. Glass.tint(_:) was checked and does not
exist as a documented API — use the standard tint(_:) modifier instead.
Re-check after: WWDC26, or by 2026-12-01. Decay risk: medium (the glass API surface shifted
during the iOS 26 beta cycle; re-confirm signatures each major).
Found a drift? Run /skill-pattern-freshness-audit apple.
Source: esaldgut/ai-native-engineering-workspace — distributed by TomeVault.