Member-only story
New SwiftUI: Lava Animation with Canvas & DragGesture.
Hello everyone, welcome to a new SwiftUI tutorial. I hope you are all doing well. Today I am going to show you how to create a Lava Animation with Canvas & DragGesture in SwiftUI 4 and Xcode 14.
Let’s get started with opening up Xcode 14. We are going to code this in the ContentVie, but first we are going to add our two colour to the assets file
Over in the ContentView we are going to build out the main ui without the Animations first.
Now we are going to build the Circle Animation and get this a run to see what we get! 🔥 We are going to be using a ViewBuilder here.
What is a Canvas in SwiftUI?
A view type that supports immediate mode drawing. Use a canvas to draw rich and dynamic 2D graphics inside a SwiftUI view. The canvas passes a GraphicsContext to the closure that you use to perform immediate mode drawing operations.