Animating the text labels
Now, let’s add two labels that can act as a guide for the user to watch their breath. Still working in the ZStack
and moving directly underneath the previous line of code, add another ZStack
, and fill it with the following:
//MARK: - ANIMATE TEXT LABELS SO THEY GROW AND SHRINK //a ZStack so we can offset the entire scene vertically ZStack { Group { Text("Breathe In") .font(Font.custom("papyrus", size: 35)) .foregroundColor(Color(UIColor.green)) .opacity(breatheInLabel ? 0 : 1) .scaleEffect(breatheInLabel ? 0 : 1) ...