---
title: Animatable()
framework: swiftui
role: symbol
role_heading: Macro
path: swiftui/animatable()
---

# Animatable()

A member and extension macro that, when applied to a struct, class or enum declaration, synthesizes the conformance to Animatable and its requirement, the animatableData property using the existing animatable properties of the type this macro is applied to.

## Declaration

```swift
@attached(extension, conformances: Animatable) @attached(member, names: named(animatableData)) macro Animatable()
```

## Overview

Overview @Animatable struct CoolShape: Shape {     var width: CGFloat     var angle: Angle     @AnimatableIgnored var isOpaque: Bool

// ... } In the above code, animatableData will be synthesized using width and angle properties of CoolShape structure.  Since changes to isOpaque property cannot be animated, it is annotated with @AnimatableIgnored. note: The @Animatable macro will not generate an Animatable conformance if the type already conforms to Animatable. note: It is only possible to attach @Animatable to types with properties. note: @Animatable will not include computed properties in the synthesized animatableData.

## See Also

### Animating data

- [AnimatableIgnored()](swiftui/animatableignored().md)
- [animatableData](swiftui/animatable/animatabledata-6nydg.md)
- [AnimatableData](swiftui/animatable/animatabledata-swift.associatedtype.md)
