How to animate a UIView

In this example we have two UIViews:

  • one backgroundView which does not change, and
  • one numberView which can be moved, for example by a pan gesture (we’re not dealing with that though)

Once the user lets go of the movable numberView, we want to reset the view back to the middle, to the same position as the backgroundView. Here’s how we do that:

Find more details in Apple’s UI View Class Reference

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.