From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,700 courses taught by industry experts.

MatchedGeometryEffect modifier

MatchedGeometryEffect modifier

From the course: iOS Development Tips

MatchedGeometryEffect modifier

- [Instructor] One of the cooler iOS 14 SwiftUI enhancements is Matched Geometry, which gives you animated moves between two views. Let's look at how to use this special animation in your app. And I have an exercise file here, which places orders onto a list on the bottom here, which actually is a scroll list. And we'll also switch out where I put Pizza Order on the top here. And right now it doesn't have any animation, so let's go ahead and add some animation, and make this look a lot cooler with some animation. Now, you'll notice here I have for the title view, which is the one I've got up top here, I've got an onTap modifier toggling the position of the text and RoundedRectangle. Now I can animate this simply by putting in withAnimation, and if we look at this top part here, we get a, the animation fades back and forth, but we don't have really a move. And what I want to do is I actually want to switch the locations of…

Contents