Animation - SwiftUI
Introduction I was eager to learn about creating complex animations in SwiftUI. The few questions that were on my mind included what types of animations exist and what I can animate. Here is what I found: Types of Animation SwiftUI has explicit and implicit animation types. Implicit Animation: This is specified with the .animation() modifier. SwiftUI will animate changes in old and new values. struct ImplicitAnimation: View { @State private var half = false @State private var dim = false var body: some View { Image("tower") .scaleEffect(half ? 0.5 : 1.0) .opacity(dim ? 0.2 : 1.0) .animation(.easeInOut(duration: 1.0)) .onTapGesture { self.dim.toggle() self.half.toggle() } } } ...