iOS Animation Design
Plan animations that feel intentional, not decorative. Apple's HIG is clear: "Don't add motion for the sake of adding motion. Gratuitous or excessive animation can distract people and may make them feel disconnected or physically uncomfortable." Every animation must serve a purpose — guide attention, communicate state changes, reinforce spatial relationships, or provide feedback.
Before adding any custom animation, ask: does the system already handle this? Many system components include motion automatically — Liquid Glass (iOS 26) responds to touch with greater emphasis and produces more subdued effects for trackpad interaction. Standard controls, navigation transitions, and sheets already animate. Custom motion should fill gaps the system doesn't cover, not replace what it already does well.
Design Process
Step 1: Understand the Animation Context
Before proposing options, gather context about what needs to animate and why:
- - What triggers it? User action (tap, swipe, drag), state change (data loaded, error), or lifecycle event (appear, disappear)?
- What's the purpose? Feedback, spatial orientation, content transition, delight, or status communication?
- Where in the app? Navigation flow, in-screen state change, overlay/modal, or background ambient?
- How frequent? Once per session (onboarding), every interaction (tab switch), or continuous (progress indicator)? Apple's HIG warns: "In apps, generally avoid adding motion to UI interactions that occur frequently. The system already provides subtle animations for interactions with standard interface elements."
- Deployment target? Which iOS version floor determines available APIs.
- Input methods? Touch, trackpad, keyboard, VoiceOver? iOS 26's Liquid Glass adapts motion intensity based on input — direct touch gets more emphasis, indirect input is more subdued. Custom animations should follow the same principle.
Step 2: Present 2-3 Animation Approaches
For each animation need, present 2-3 distinct approaches. Each option should feel meaningfully different — not minor variations of the same idea. Structure each option as:
CODEBLOCK0
Then provide a Recommendation with rationale tied to the gathered context. The recommendation should consider:
- - API availability relative to the deployment target
- Complexity budget — simpler is better unless the animation is a signature moment
- Whether the system already handles it — prefer system-provided motion over custom implementations
- Consistency with existing app motion language
- Cancellability — can users interrupt or skip it? ("Don't make people wait for an animation to complete before they can do anything" — Apple HIG)
- Accessibility (can it gracefully degrade with Reduce Motion?)
- Multimodal feedback — animation alone shouldn't be the only signal. "Supplement visual feedback by also using alternatives like haptics and audio" (Apple HIG)
Step 3: Compile the Animation Spec
Once the user selects an approach (or confirms the recommendation), produce a structured spec. This spec is the contract between design and implementation — it should contain everything needed to write the code without ambiguity.
Animation Spec Format
CODEBLOCK1
Animation Categories
When designing, think in terms of these categories. Each has different expectations for timing, easing, and purpose.
Navigation & Scene Transitions
Screen-to-screen movement. Users expect spatial consistency — where did I come from, where am I going? These should feel fast and confident.
- - Push/pop with hero elements (
matchedGeometryEffect, navigationTransition(.zoom)) - Full-screen covers and sheets (custom
Transition protocol) - Tab switches (crossfade, slide, or matched geometry)
- Onboarding flows (page-based with progressive reveal)
Timing: 0.3–0.5s. Easing: spring-based (.snappy or .smooth). Interruption: must handle back-gesture gracefully.
Micro-Interactions
Small, immediate feedback for user actions. Apple's HIG emphasizes brevity: "When animated feedback is brief and precise, it tends to feel lightweight and unobtrusive, and it can often convey information more effectively than prominent animation." These should be near-instant and never block interaction. For frequent interactions, strongly consider whether the system's built-in animation is sufficient before adding custom motion.
- - Button press states (scale + haptic)
- Toggle/switch animations
- Like/favorite/bookmark responses
- Pull-to-refresh indicators
- Text field focus transitions
- Swipe action reveals
Timing: 0.1–0.3s. Easing: .snappy or .spring(duration: 0.2, bounce: 0.4). Always pair with sensoryFeedback — haptics reinforce the visual feedback and communicate to users who can't see the animation.
Content Transitions
When data changes within a view — numbers updating, content swapping, list reordering.
- - Numeric text transitions (
.contentTransition(.numericText)) - Image crossfades
- List item insertion/removal
- Skeleton-to-content reveal
- Error/empty/loaded state switches
Timing: 0.2–0.35s. Easing: .smooth or .easeInOut. Use animation(_:value:) tied to the changing data.
Gesture-Driven Animations
Interactive animations where the user directly controls progress. These need to feel physically connected to the finger — no lag, no disconnection.
- - Card dismiss (swipe to remove)
- Drawer/sheet drag
- Pinch-to-zoom
- Rotation interactions
- Scroll-linked parallax (
scrollTransition)
Spring-based completion is essential. Track velocity on release. Use UIViewPropertyAnimator for UIKit or GestureState + spring for SwiftUI.
Loading & Progress
Communicate waiting and progress. Should feel alive without being distracting.
- - Skeleton screens (shimmer with gradient mask)
- Indeterminate spinners (SF Symbol
.symbolEffect(.pulse)) - Determinate progress (animated bar/ring)
- Content placeholder pulse (
PhaseAnimator)
Keep looping animations lightweight — they run continuously and must not drain battery or cause hitches.
Ambient & Decorative
Background motion that establishes mood. Use sparingly — these are the easiest to overdo.
- - Animated gradients (
MeshGradient with timer-driven point shifts) - Floating particle effects
- Subtle parallax on device tilt
- Background blur transitions
Always disable or simplify with Reduce Motion. These are the first to cut for performance.
Principles
- 1. Purpose over polish — If you can't articulate why something animates, it shouldn't. Apple's HIG: "Don't add motion for the sake of adding motion."
- System first — Many system components already include motion (Liquid Glass, navigation transitions, sheets, SF Symbol effects). Check whether the system handles it before designing custom motion. Custom animation should fill gaps, not duplicate the system.
- Brevity over spectacle — "Aim for brevity and precision in feedback animations" (Apple HIG). Brief animations convey information more effectively than prominent ones. A succinct response tied to the action beats an elaborate sequence.
- Springs over curves — Spring animations feel physical. Use
duration + bounce parameters, not bezier curves, unless you have a specific reason. - Reduce Motion is not optional — Every animation spec must include a Reduce Motion fallback. Apple's HIG: "Make motion optional. Not everyone can or wants to experience the motion in your app." This also means never using animation as the only way to communicate important information.
- Multimodal feedback — Supplement animation with haptics (
.sensoryFeedback) and audio where appropriate. Animation alone shouldn't carry critical state changes. - Cancellation is a right — "Don't make people wait for an animation to complete before they can do anything, especially if they have to experience the animation more than once" (Apple HIG). Every animation must be interruptible.
- Realistic spatial feedback — Motion should follow the user's gesture and expectations. If someone slides a view down, they expect to dismiss it by sliding down, not sideways. Feedback that defies spatial logic disorients people.
- Speed earns trust — Animations under 0.3s feel responsive. Over 0.5s feels sluggish unless it's a signature moment. When in doubt, go faster.
- Consistency compounds — Use the same spring parameters across similar interactions. A consistent motion language makes the whole app feel cohesive. Define a small set of timing presets and reuse them.
iOS动画设计
规划那些感觉有目的性而非装饰性的动画。苹果的HIG明确指出:不要为了添加动画而添加动画。无端的或过度的动画会分散用户注意力,可能让他们感到脱节或身体不适。每个动画都必须服务于某个目的——引导注意力、传达状态变化、强化空间关系或提供反馈。
在添加任何自定义动画之前,先问:系统是否已经处理了这个?许多系统组件已经包含自动动画——Liquid Glass(iOS 26)对触摸的响应更加突出,而对触控板交互则产生更柔和的效果。标准控件、导航转场和表单已经自带动画。自定义动画应填补系统未覆盖的空白,而非替换系统已经做好的部分。
设计流程
第一步:理解动画上下文
在提出方案之前,收集关于需要动画化的内容及其原因的背景信息:
- - 触发条件是什么? 用户操作(点击、滑动、拖拽)、状态变化(数据加载、错误)或生命周期事件(出现、消失)?
- 目的是什么? 反馈、空间定位、内容过渡、愉悦感或状态传达?
- 在应用的哪个位置? 导航流程、屏幕内状态变化、覆盖层/模态窗口或后台环境?
- 频率如何? 每次会话一次(引导页)、每次交互(标签切换)或持续进行(进度指示器)?苹果HIG警告:在应用中,通常避免为频繁发生的UI交互添加动画。系统已经为标准界面元素的交互提供了微妙的动画。
- 部署目标? 最低iOS版本决定了可用的API。
- 输入方式? 触摸、触控板、键盘、旁白?iOS 26的Liquid Glass会根据输入方式调整动画强度——直接触摸获得更多强调,间接输入则更柔和。自定义动画应遵循相同原则。
第二步:提供2-3种动画方案
针对每个动画需求,提供2-3种不同的方案。每个方案应有实质性的差异——而非同一想法的微小变体。每个方案的结构如下:
markdown
方案[N]:[名称]
方法:[1-2句描述运动设计]
技术:[使用哪个Apple API——SwiftUI动画、KeyframeAnimator、matchedGeometryEffect等]
特性:[感觉如何——干脆、有趣、优雅、微妙、戏剧性]
复杂度:[低/中/高——实现和维护成本]
iOS最低版本:[所需最低iOS版本]
然后提供推荐方案,并附上与收集到的上下文相关的理由。推荐应考虑:
- - 相对于部署目标的API可用性
- 复杂度预算——除非动画是标志性时刻,否则越简单越好
- 系统是否已处理——优先使用系统提供的动画而非自定义实现
- 与应用现有动画语言的一致性
- 可取消性——用户能否中断或跳过它?(不要让用户在动画完成前等待才能做任何事——苹果HIG)
- 无障碍性(在减少动态效果下能否优雅降级?)
- 多模态反馈——动画本身不应是唯一的信号。通过使用触觉和音频等替代方案来补充视觉反馈(苹果HIG)
第三步:编制动画规格
一旦用户选择了方案(或确认了推荐),生成结构化规格。该规格是设计与实现之间的契约——应包含编写代码所需的一切,无歧义。
动画规格格式
markdown
动画规格:[名称]
概述
[1-2句:此动画的作用及其存在的原因]
触发条件
- - 事件:[什么启动动画——点击、状态变化、出现、手势等]
- 方向:[正向/反向/双向]
运动设计
属性
| 属性 | 起始值 | 结束值 | 曲线 | 时长 |
|---|
| 不透明度 | 0 | 1 | .easeOut | 0.25s |
| 缩放 |
0.8 | 1.0 | .spring(duration: 0.5, bounce: 0.3) | — |
| 偏移.y | 20 | 0 | .spring(duration: 0.5, bounce: 0.3) | — |
时间控制
- - 总时长:[从头到尾的时间]
- 错开延迟:[如果多个元素,每个之间的延迟]
- 中断处理:[如果在动画进行中再次触发会发生什么——取消、反向、排队]
手势绑定(如果可交互)
- - 手势类型:[拖拽、长按、旋转、缩放]
- 进度映射:[手势进度如何映射到动画进度]
- 阈值:[动画提交与取消的临界点]
- 速度处理:[释放速度如何影响完成]
无障碍与多模态反馈
- - 减少动态效果:[发生什么——淡入淡出、即时、简化版本]
- 旁白:[状态变化是否需要任何播报]
- 触觉反馈:[哪种sensoryFeedback类型与此动画配对——.impact、.selection、.success等]
- 音频:[如果状态变化足够重要,可选的音效提示]
- 动态字体:[布局变化是否影响动画?]
实现说明
- - 推荐API:[SwiftUI withAnimation、KeyframeAnimator、PhaseAnimator、matchedGeometryEffect、UIViewPropertyAnimator等]
- 状态模型:[哪个@State/@Binding驱动此动画]
- 可提取组件:[是/否——这应该是可复用的ViewModifier还是View?]
动画类别
在设计时,从这些类别角度思考。每个类别对时间、缓动和目的有不同的期望。
导航与场景转场
屏幕到屏幕的移动。用户期望空间一致性——我从哪里来,我要去哪里?这些应感觉快速且自信。
- - 带有英雄元素的推入/弹出(matchedGeometryEffect、navigationTransition(.zoom))
- 全屏覆盖层和表单(自定义Transition协议)
- 标签切换(交叉淡入、滑动或匹配几何)
- 引导流程(基于页面的渐进式展示)
时间:0.3–0.5秒。缓动:基于弹簧(.snappy或.smooth)。中断:必须优雅处理返回手势。
微交互
对用户操作的小型即时反馈。苹果HIG强调简洁:当动画反馈简短而精确时,它往往感觉轻量且不突兀,并且通常比突出的动画更有效地传达信息。这些应近乎即时,绝不阻塞交互。对于频繁交互,在添加自定义动画前,强烈考虑系统内置动画是否已足够。
- - 按钮按压状态(缩放+触觉)
- 开关/切换动画
- 点赞/收藏/书签响应
- 下拉刷新指示器
- 文本字段焦点过渡
- 滑动操作揭示
时间:0.1–0.3秒。缓动:.snappy或.spring(duration: 0.2, bounce: 0.4)。始终与sensoryFeedback配对——触觉强化视觉反馈,并向无法看到动画的用户传达信息。
内容过渡
当视图内数据变化时——数字更新、内容切换、列表重新排序。
- - 数字文本过渡(.contentTransition(.numericText))
- 图像交叉淡入
- 列表项插入/删除
- 骨架屏到内容揭示
- 错误/空/已加载状态切换
时间:0.2–0.35秒。缓动:.smooth或.easeInOut。使用绑定到变化数据的animation(_:value:)。
手势驱动动画
用户直接控制进度的交互式动画。这些需要感觉与手指物理连接——无延迟,无脱节。
- - 卡片关闭(滑动移除)
- 抽屉/表单拖拽
- 捏合缩放
- 旋转交互
- 滚动联动视差(scrollTransition)
基于弹簧的完成至关重要。在释放时追踪速度。对UIKit使用UIViewPropertyAnimator,对SwiftUI使用GestureState+弹簧。
加载与进度
传达等待和进度。应感觉有活力而不分散注意力。
- - 骨架屏(带渐变遮罩的闪烁效果)
- 不确定旋转器(SF Symbol .symbolEffect(.pulse))
- 确定进度(动画条/环)
- 内容占位脉冲(PhaseAnimator)
保持循环动画轻量——它们持续运行,不得消耗电池或导致卡顿。
环境与装饰性
建立氛围的背景运动。谨慎使用——这些最容易过度。
- - 动画渐变(MeshGradient带定时驱动的点偏移)
- 浮动粒子效果
- 设备倾斜时的微妙视差
- 背景模糊过渡
在减少动态效果下始终禁用或简化。这些是性能优化的首选削减对象。
原则
- 1. 目的优于精致——如果你无法说明为什么某个东西需要动画,那它就不该有。苹果HIG:不要为了添加动画而添加动画。
- 系统优先——许多系统组件已包含动画(Liquid Glass、导航转场、表单、SF Symbol效果)。在设计自定义动画前,检查系统是否已处理。自定义动画应填补空白,而非复制系统。
3