返回顶部
s

swiftui-code-reviewSwiftUI代码审查

Reviews SwiftUI code for view composition, state management, performance, and accessibility. Use when reviewing .swift files containing SwiftUI views, property wrappers (@State, @Binding, @Observable), or UI code.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.2.0
安全检测
已通过
124
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

swiftui-code-review

SwiftUI 代码审查

快速参考

问题类型参考文档
视图提取、修饰符、body 复杂度references/view-composition.md
@State、@Binding、@Observable、@Bindable
references/state-management.md | | LazyStacks、AnyView、ForEach、标识符 | references/performance.md | | VoiceOver、动态字体、标签、特征 | references/accessibility.md |

审查清单

  • - [ ] View body 不超过10个组合元素(提取子视图)
  • [ ] 修饰符顺序正确(padding 在 background 之前)
  • [ ] @StateObject 用于视图拥有的对象,@ObservedObject 用于传入的对象
  • [ ] @Bindable 用于与 @Observable 的双向绑定(iOS 17+)
  • [ ] 50+ 项的滚动列表使用 LazyVStack/LazyHStack
  • [ ] 不使用 AnyView(改用 @ViewBuilder 或泛型)
  • [ ] ForEach 使用稳定的 Identifiable ID(而非数组索引)
  • [ ] 所有图片/图标都有 accessibilityLabel
  • [ ] 自定义控件有 accessibilityAddTraits(.isButton)
  • [ ] 支持动态字体(不使用固定字号)
  • [ ] 异步工作使用 .task 修饰符(而非 onAppear + Task)

何时加载参考文档

  • - 复杂视图 body 或修饰符链 -> view-composition.md
  • 属性包装器用法(@State、@Observable)-> state-management.md
  • 列表性能或视图标识问题 -> performance.md
  • VoiceOver 或无障碍实现 -> accessibility.md

审查问题

  1. 1. 这个大型视图 body 能否拆分为更小、可复用的视图?
  2. 修饰符顺序是否有意为之?(padding -> background -> frame)
  3. @StateObject/@ObservedObject 的所有权使用是否正确?
  4. LazyVStack 能否提升此 ScrollView 的性能?
  5. VoiceOver 用户能否理解此界面?

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 swiftui-code-review-1776098972 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 swiftui-code-review-1776098972 技能

通过命令行安装

skillhub install swiftui-code-review-1776098972

下载

⬇ 下载 swiftui-code-review v1.2.0(免费)

文件大小: 6.64 KB | 发布时间: 2026-4-14 13:54

v1.2.0 最新 2026-4-14 13:54
- Added detailed review checklist covering key SwiftUI best practices for view composition, state management, performance, and accessibility.
- Included quick reference table linking to supporting documentation for common review topics.
- Provided guidance on when to consult reference materials based on code patterns.
- Listed essential review questions to guide consistent code evaluation.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部