From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Basic animation

Basic animation

- [Instructor] Much of our basic structure is in place. It's time to jazz up the app for a better look. To start, we'll add animation to smooth out the visual feedback to user interactions. Now we're going to be using the grid view for most of this animation. So let's go down here to onAppear and get rid of this random, and I'm going to just make present grid true. That'll give us our grid all the time. And there are two types of animation that I'm going to be using in Swift UI. Implicit and explicit. Implicit animation uses the animation modifier. The animation modifier takes two parameters, the type of animation and a value to watch to change. When that value changes, the animation activates for the view modified in any sub view. So let's go over to menu grid view and try this out. I'll add an animation modifier to my favorites grid. So let's go right where it says favorites grid's view. And I can go right underneath…

Contents