Swiftui Animation logo

Swiftui Animation

Community
jamesrochabrun
swiftui-animation

This skill provides comprehensive guidance for implementing advanced SwiftUI animations, transitions, matched geometry effects, and Metal shader integration. Use when building animations, view transitions, hero animations, or GPU-accelerated effects in SwiftUI apps for iOS and macOS.

Overview

Publisherjamesrochabrun
Repositoryskills
Skill nameswiftui-animation
Stars
209
Forks
25
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jamesrochabrun on GitHub. Read the source before you install it.

Installation

Install the Swiftui Animation AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jamesrochabrun/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/swiftui-animation .claude/skills/swiftui-animation
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Swiftui Animation in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Swiftui Animation on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Swiftui Animation is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SwiftUI Animation Expert

Expert guidance for implementing advanced SwiftUI animations and Metal shader integration. Covers animation curves, springs, transitions, matched geometry effects, PhaseAnimator, KeyframeAnimator, and GPU-accelerated shader effects.

When to Use This Skill

  • Understanding motion design principles and when to use animation
  • Making animations accessible and platform-appropriate
  • Implementing animations in SwiftUI (springs, easing, keyframes)
  • Creating view transitions (fade, slide, scale, custom)
  • Building hero animations with matchedGeometryEffect
  • Adding GPU-accelerated effects with Metal shaders
  • Optimizing animation performance
  • Creating multi-phase orchestrated animations

Quick Reference

Animation Basics

swift
// Explicit animation (preferred)
withAnimation(.spring(response: 0.4, dampingFraction: 0.75)) {
    isExpanded.toggle()
}

// iOS 17+ spring presets
withAnimation(.snappy) { ... }  // Fast, small bounce
withAnimation(.smooth) { ... }  // Gentle, no bounce
withAnimation(.bouncy) { ... }  // More bounce

Common Transitions

swift
// Basic
.transition(.opacity)
.transition(.scale)
.transition(.slide)
.transition(.move(edge: .bottom))

// Combined
.transition(.move(edge: .trailing).combined(with: .opacity))

// Asymmetric
.transition(.asymmetric(
    insertion: .move(edge: .bottom),
    removal: .opacity
))

Matched Geometry Effect

swift
@Namespace var namespace

// Source view
ThumbnailView()
    .matchedGeometryEffect(id: "hero", in: namespace)

// Destination view
DetailView()
    .matchedGeometryEffect(id: "hero", in: namespace)

Metal Shader Effects (iOS 17+)

swift
// Color manipulation
.colorEffect(ShaderLibrary.invert())

// Pixel displacement
.distortionEffect(
    ShaderLibrary.wave(.float(time)),
    maxSampleOffset: CGSize(width: 20, height: 20)
)

// Full layer access
.layerEffect(ShaderLibrary.blur(.float(radius)), maxSampleOffset: .zero)

Reference Materials

Detailed documentation is available in references/:

  • motion-guidelines.md - HIG Motion design principles

    • Purpose-driven motion philosophy
    • Accessibility requirements
    • Platform-specific considerations (iOS, visionOS, watchOS)
    • Animation anti-patterns to avoid
  • animations.md - Complete animation API guide

    • Implicit vs explicit animations
    • Spring parameters and presets
    • Animation modifiers (speed, delay, repeat)
    • PhaseAnimator for multi-step sequences
    • KeyframeAnimator for property-specific timelines
    • Custom animatable properties
  • transitions.md - View transition guide

    • Built-in transitions (opacity, scale, slide, move)
    • Combined and asymmetric transitions
    • Matched geometry effect implementation
    • Hero animation patterns
    • Content transitions (iOS 17+)
    • Custom transition creation
  • metal-shaders.md - GPU shader integration

    • SwiftUI shader modifiers (colorEffect, distortionEffect, layerEffect)
    • Writing Metal shader functions
    • Embedding MTKView with UIViewRepresentable
    • Cross-platform Metal integration (iOS/macOS)
    • Performance considerations

Common Patterns

Expandable Card

swift
struct ExpandableCard: View {
    @State private var isExpanded = false

    var body: some View {
        VStack {
            RoundedRectangle(cornerRadius: isExpanded ? 20 : 12)
                .fill(.blue)
                .frame(
                    width: isExpanded ? 300 : 150,
                    height: isExpanded ? 400 : 100
                )
        }
        .onTapGesture {
            withAnimation(.spring(response: 0.35, dampingFraction: 0.75)) {
                isExpanded.toggle()
            }
        }
    }
}

List Item Appearance

swift
ForEach(Array(items.enumerated()), id: \.element.id) { index, item in
    ItemRow(item: item)
        .transition(.asymmetric(
            insertion: .move(edge: .trailing).combined(with: .opacity),
            removal: .move(edge: .leading).combined(with: .opacity)
        ))
        .animation(.spring().delay(Double(index) * 0.05), value: items)
}

Pulsing Indicator

swift
Circle()
    .fill(.blue)
    .frame(width: 20, height: 20)
    .scaleEffect(isPulsing ? 1.2 : 1.0)
    .opacity(isPulsing ? 0.6 : 1.0)
    .onAppear {
        withAnimation(.easeInOut(duration: 1.0).repeatForever(autoreverses: true)) {
            isPulsing = true
        }
    }

Best Practices

  1. Motion should be purposeful - Don't add animation for its own sake; support the experience without overshadowing it
  2. Make motion optional - Supplement with haptics and audio; never use motion as the only way to communicate
  3. Aim for brevity - Brief, precise animations feel lightweight and convey information effectively
  4. Prefer explicit animations - Use withAnimation over .animation() modifier for clarity
  5. Use spring animations - They feel more natural and iOS-native
  6. Start with .spring(response: 0.35, dampingFraction: 0.8) - Good default for most interactions
  7. Keep animations under 400ms - Longer feels sluggish
  8. Let people cancel motion - Don't force users to wait for animations to complete
  9. Test on device - Simulator animation timing differs
  10. Profile shader performance - GPU time matters for complex effects

Troubleshooting

Animation not working

  • Ensure state change is wrapped in withAnimation
  • Check that the property is animatable
  • Verify the view is actually changing

Matched geometry jumps

  • Both views must use the same ID and namespace
  • Use explicit withAnimation when toggling
  • Check zIndex for proper layering

Shader not appearing

  • Verify .metal file is added to target
  • Check shader function signature matches expected format
  • Ensure maxSampleOffset is set correctly for distortion effects

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Swiftui Animation AI skill do?

This skill provides comprehensive guidance for implementing advanced SwiftUI animations, transitions, matched geometry effects, and Metal shader integration. Use when building animations, view transitions, hero animations, or GPU-accelerated effects in SwiftUI apps for iOS and macOS.

Why use Swiftui Animation on TypingMind?

Because you install it once and use it with any model. Swiftui Animation is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Swiftui Animation in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jamesrochabrun/skills/tree/main/skills/swiftui-animation. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Swiftui Animation?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Swiftui Animation?

As many as you like. As long as a model supports skills, you can use Swiftui Animation with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Swiftui Animation AI skill free?

Yes. It is published on GitHub by jamesrochabrun under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇