技能 Apple HIG: Presentation Components
📋

Apple HIG: Presentation Components

安全

Apple HIG:对话框和模态窗口

获取 Apple 人机界面指南中关于警报、工作表、弹出窗口和操作表的内容。为每个平台选择合适的模态模式,避免使用中断用户的对话框时的常见 UX 错误。

支持: Claude Codex Code(CC)
🥉 73 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“Apple HIG: Presentation Components”。 Should I use an alert or action sheet for delete confirmation?

预期结果:

Use an action sheet on iPhone when there are multiple choices (Delete vs Save Draft). Use an alert when it's a simple confirmation with two buttons (Confirm Delete vs Cancel). The action sheet slides up from the bottom on iPhone, making it clear there are multiple options.

正在使用“Apple HIG: Presentation Components”。 How do I handle destructive actions in alerts?

预期结果:

Mark destructive buttons with red text using the destructive role. Place destructive buttons at the top where users are less likely to tap reflexively. Always include a Cancel button. Avoid making the destructive button the default.

正在使用“Apple HIG: Presentation Components”。 When should I use sheets instead of full-screen modals?

预期结果:

Use sheets for focused tasks that benefit from maintaining context with the underlying content. Sheets slide in from the edge (iOS) or attach to a window (macOS). Ideal for creating items, editing settings, or multi-step forms where seeing the parent content is helpful.

安全审计

安全
v1 • 2/25/2026

All static findings are false positives. The skill contains Apple's Human Interface Guidelines documentation for UI presentation components. The flagged patterns (backticks, URLs, generic English words) are legitimate documentation elements, not security threats.

5
已扫描文件
507
分析行数
3
发现项
1
审计总数
中风险问题 (1)
Markdown Code Formatting (False Positive)
Static scanner flagged backticks as shell execution. These are markdown code fences used to format API references like `UIAlertController.Style.actionSheet`. No executable code present.
低风险问题 (2)
Documentation URL References (False Positive)
Static scanner flagged hardcoded URLs. These are legitimate references to Apple's official developer documentation at developer.apple.com.
Generic English Words (False Positive)
Static scanner flagged words like 'encrypt', 'server', 'system', 'command' as security keywords. These are normal terms in Apple's HIG documentation (e.g., 'secure text field', 'server connection', 'system-defined style').
审计者: claude

质量评分

45
架构
100
可维护性
85
内容
50
社区
96
安全
74
规范符合性

你能构建什么

选择确认对话框类型

用户想要确认破坏性操作(删除、擦除、移除)。技能根据平台推荐使用警报或操作表,并提供按钮样式指导。

模态呈现决策

用户问'我应该使用工作表还是弹出窗口?'技能解释工作表何时更好地保持上下文,以及弹出窗口在 iPad/Mac 上的适用场景。

减少警报疲劳

用户抱怨应用中模态窗口过多。技能建议内联替代方案、撤销模式,以及何时避免中断用户。

试试这些提示

基本组件指导
Should I use an alert or an action sheet for [use case]?
平台特定行为
How does [component] behave differently on iPhone vs iPad?
按钮和文本指南
What are the best practices for alert button labels and ordering?
替代模式
What are alternatives to using a modal for [scenario]?

最佳实践

  • Use alerts sparingly and only for critical situations requiring immediate attention
  • Provide specific, actionable button labels (Delete, Save) instead of generic OK/Cancel
  • Always include a Cancel button for destructive action confirmations

避免

  • Using alerts for informative messages that could be shown inline
  • Placing destructive actions as the default button
  • Using the same component for all modal scenarios without considering alternatives

常见问题

When should I use an alert vs a sheet?
Use alerts for critical interruptions requiring immediate response. Use sheets for focused tasks where maintaining context with the underlying content is helpful.
Can I use the same design across iPhone and iPad?
Not always. Action sheets appear as popovers on iPad. Sheets adapt differently. Always test on target platforms.
How many buttons should an alert have?
Up to three buttons maximum. Use one button for simple acknowledgment, two for confirm/cancel, three when a destructive option exists.
What is the cancel button placement?
Place Cancel at the bottom of action sheets (iOS) or leading side (macOS). On watchOS, place in upper-left corner.
Should I use OK or specific button labels?
Always prefer specific labels like Delete, Save, or Confirm. Use OK only for purely informational alerts.
How do I make modals accessible?
Ensure voiceover announces the title, message, and all button options. Support keyboard navigation for macOS modals.