← 返回
未分类 中文

Ios Animation Code Review

Reviews iOS animation code for correctness, performance, accessibility, and Apple API best practices. Use when reviewing .swift files containing animation co...
审查 iOS动画代码的正确性、性能、可访问性以及 Apple API 最佳实践。用于审查包含动画代码的 .swift 文件。
anderskev anderskev 来源
未分类 clawhub v1.2.1 2 版本 100000 Key: 无需
★ 0
Stars
📥 453
下载
💾 8
安装
2
版本
#latest

概述

iOS Animation Code Review

Quick Reference

Issue TypeReference
-----------------------
Spring parameters, withAnimation misuse, phase/keyframe bugsreferences/swiftui-animation-patterns.md
Frame drops, offscreen rendering, main thread blockingreferences/performance.md
Reduce Motion, VoiceOver, motion sensitivityreferences/accessibility.md
Transition protocol, matchedGeometryEffect, navigation transitionsreferences/transitions.md

Hard gates (sequence)

Complete in order for the files in scope. If a step fails, omit the finding, re-anchor, or downgrade to a question—do not ship accusations without meeting the pass condition.

StepWhat you doPass condition (objective)
-----------------------------------------------
1. InventoryList each file under review and where animation APIs appear (line ranges or symbol names: withAnimation, .animation, matchedGeometryEffect, PhaseAnimator, UIKit/CA animators, etc.).A written list exists; files with no animation APIs are explicitly marked out of scope.
2. AnchorRe-read the cited region in the current file or diff hunk before naming an issue.Each [FILE:LINE] still shows the behavior; stale line numbers are fixed or the finding is dropped.
3. EvidenceFor framework-specific claims (spring curves, Transition conformance, Reduce Motion), cross-check the matching row in Quick Reference against references/*.md.The finding’s detail names the reference file used, or states inline-only (structural/readability with no framework rule).
4. ReportEmit findings using Output Format.Headers match [FILE:LINE] ISSUE_TITLE; checklist items below are applied only where gates 1–2 covered that code.

Output Format

Report each finding as:

[FILE:LINE] ISSUE_TITLE

Example: [AnimatedCard.swift:42] Missing Reduce Motion fallback for spring animation

All details, code suggestions, and rationale follow after the header line.

Review Checklist

  • [ ] @Environment(\.accessibilityReduceMotion) checked — animations have Reduce Motion fallback
  • [ ] Animation is not the sole feedback channel — important state changes pair with haptics (.sensoryFeedback) or audio
  • [ ] Custom animation isn't duplicating system-provided motion (standard nav transitions, sheet presentation, SF Symbol effects)
  • [ ] Animations on frequent interactions are brief and unobtrusive — or absent (system handles it)
  • [ ] All animations are interruptible — user is never forced to wait for completion before interacting
  • [ ] Spring animations use duration/bounce parameters (not raw mass/stiffness/damping unless UIKit/CA)
  • [ ] No deprecated .animation() without value: parameter
  • [ ] withAnimation wraps state changes, not view declarations
  • [ ] matchedGeometryEffect IDs are stable and unique within the namespace
  • [ ] geometryGroup() used when parent geometry animates with child views appearing
  • [ ] Looping animations (PhaseAnimator, symbolEffect) have finite phases or appropriate trigger
  • [ ] No CATransaction.setAnimationDuration() in UIView-backed layers (use UIView.animate instead)
  • [ ] Interactive animations handle interruption (re-trigger mid-flight doesn't break state)
  • [ ] Shadow animations provide explicit shadowPath (avoids per-frame recalculation)
  • [ ] Gesture-driven animations preserve velocity on release for natural completion
  • [ ] Gesture-driven feedback follows spatial expectations (dismiss direction matches reveal direction)
  • [ ] No animation of .id() modifier (destroys view identity — use transition or matchedGeometryEffect instead)

When to Load References

  • Incorrect spring setup or withAnimation scope issues → swiftui-animation-patterns.md
  • Hitches, dropped frames, or expensive animations in scroll views → performance.md
  • Missing Reduce Motion handling or motion accessibility → accessibility.md
  • matchedGeometryEffect glitches or custom Transition bugs → transitions.md

Review Questions

  1. Does every animation have a Reduce Motion fallback that preserves the information conveyed? Is animation the only feedback channel, or are haptics/audio supplementing it?
  2. Is this custom animation necessary, or does the system already provide it (standard transitions, SF Symbol effects, Liquid Glass)?
  3. Could this animation cause frame drops — is it animating expensive properties (blur, shadow without path, mask) in a list or scroll view?
  4. Are all animations interruptible? Can the user act without waiting for completion? Does gesture-driven feedback follow spatial expectations?
  5. Is withAnimation scoped to the minimal state change needed, or is it wrapping unrelated mutations?
  6. For matchedGeometryEffect — are source and destination using the same ID and namespace, and is only one visible at a time?

版本历史

共 2 个版本

  • v1.2.1 当前
    2026-05-03 06:47 安全 安全
  • v1.2.0
    2026-03-31 01:23

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 75 📥 182,403
dev-programming

Github

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

Deepagents Implementation

anderskev
使用 Deep Agents 实现代理,适用于创建代理、配置后端、定义子代理、添加中间件或设置...
★ 0 📥 699