Duplicating and animating the wave shape in the ContentView
When creating our ocean, we’ll stack six waves in our scene and stagger the animation values so that they animate at different times. Working in the ContentView
file now, we’ll start by adding a variable inside the ContentView
struct that will toggle the animation on:
@State private var animateOffset = false
Next, let’s add a ZStack
that will hold all the waves, and inside that, let’s set the background to a blue sky color:
ZStack { //MARK: - BACKGROUND Color.blue .opacity(0.5) .edgesIgnoringSafeArea(.all) &...