SuperAPI AI 工具集

animation-patterns

设计与创作

查看项目

更新于 10-16 09:52

技能介绍

用途:为 SwiftUI 动画代码提供正确的 API 形态与模式,避免常见写法错误。当用户要求添加、修复或审查动画代码,或提及 spring/bounce/snappy、视图转场(插入移除、hero、zoom)、PhaseAnimator、KeyframeAnimator、SF Symbol 效果、matchedGeometryEffect 与 matchedTransitionSource、reduce motion 无障碍、动画串联、withAnimation 与 Transaction、滚动驱动效果(视差、轮播、scrollTransition、visualEffect)、MeshGradient、TextRenderer、Metal 着色器效果时启用。

主要能力:按动画目标给出决策路径——状态变化用 withAnimation 或 .animation(_:value:) 及弹簧配置;多步序列用 PhaseAnimator;多属性复杂动画用 KeyframeAnimator;视图出现消失用 transition/contentTransition/asymmetric;hero 或 zoom 导航转场用 matchedTransitionSource 与 .navigationTransition(.zoom),或 UIKit 的 preferredTransition=.zoom、matchedGeometryEffect;SF Symbol 用 .symbolEffect();滚动与着色器用 .scrollTransition、.visualEffect、MeshGradient、TextRenderer 及 ShaderLibrary 效果。

使用方式:技能内含 core-animations、phase-keyframe-animators、transitions、symbol-effects、visual-effects 等参考文件,按需求查阅对应文件;并附带 API 最低版本对照与常见错误速查。

限制与注意:审查要求检查是否尊重 reduce motion、反馈动画时长约不超过 0.5 秒(仅装饰性效果可更长)、按场景选择弹簧或线性缓动、避免使用已弃用 API(如无 value: 的 .animation(.spring()))、弹簧参数不可混用代际(response 与 bounce 不可混搭)、完成回调使用 withAnimation(:completionCriteria::completion:)、转场仅作用于受状态控制的 if/switch 视图、每帧闭包内不做分配与布局计算。具体安装命令与收费情况暂未提供。