Animating Views

We talked about how important views are on iOS, but apps are also known for their smooth animations. Perhaps one reason slick transitions and niceties are so pervasive in iOS apps is that they’re so darn easy to implement. And we’re going to add that to our little box app right now.

Let’s add another button, Remove, which will fade out the most recently added view and slide all others to new positions in its place. That might sound complicated, and on other platforms or frameworks it might be, but the iOS animation APIs make it painless. All we do is tell the system what properties of our views to animate and how long that animation should take.

We will add yet another button to our AppDelegate and wire its target/action ...

Get RubyMotion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.