title: Animating Text in Swift UI
body: <p>How would it be possible to animate <code>Text</code> or <code>TextField</code> views from Swift UI? </p>
  
  <p>By animation I mean, that when the text changes it will "count up".</p>
  
  <p>For example given some label, how can an animation be created that when I set the labels text to "100" it goes up from 0 to 100. I know this was possible in UIKit using layers and CAAnimations, but using the <code>.animation()</code> function in Swift UI and changing the text of a <code>Text</code> or <code>TextField</code> does not seem to do anything in terms of animation.</p>
  
  <p>I've taken a look at <code>Animatable</code> protocol and its related <code>animatableData</code> property but it doesn't seem like <code>Text</code> nor <code>TextField</code> conform to this. I'm trying to create a label that counts up, so given some value, say a <code>Double</code> the changes to that value would be tracked, either using <code>@State</code> or <code>@Binding</code> and then the <code>Text</code> or <code>TextField</code> would animate its content (the actual string text) from what the value was at to what it was set to.</p>
  
  <p>Edit:</p>
  
  <p>To make it clearer, I'd like to recreate a label that looks like this when animated:</p>
  
  <p><a href="https://i.stack.imgur.com/Iq6WX.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/Iq6WX.gif" alt="enter image description here"></a></p>