SwiftUI: Animation

Mar 29 2022 · Swift 5.5, iOS 15, Xcode 13

Part 1: Beginning with SwiftUI Animation

04. Combine Animations

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 03. Animation Options Next episode: 05. Challenge: Rotation

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

In this episode, you’ll work in a project called Savanna Tours: an app that offers tours in the African savanna.

struct ContentView : View {
  @State var zoomed = false

  var body: some View {
            .shadow(radius: 10)
            .onTapGesture { zoomed.toggle() }
        }
            )
            .scaleEffect((zoomed ? 4 : 1) / 3)
            .shadow(radius: 10)
x: zoomed ? geometry 600,
x: zoomed ? geometry.frame(in: .local) 600,
              x: zoomed ? geometry.frame(in: .local).midX : 600,
            .shadow(radius: 10)
            .animation(.default, value: zoomed)
            .onTapGesture { zoomed.toggle() }
            .animation(.spring(), value: zoomed)
        )
        .animation(.default)

        GeometryReader { geometry in

        🟩.offset(
          x: zoomed ? 500 : 30,
          y: -30
        )
        .animation(.default, value: zoomed)
          Image("thumb")
            .clipShape(
              RoundedRectangle(cornerRadius: zoomed ? 40 : 500)
            )
            .overlay(
            Circle()
                .fill(
                  zoomed
                    ? Color.clear
                    : Color(white: 1, opacity: 0.4)
                )
                .scaleEffect(0.8)
                .scaleEffect(0.8)
            )
            .saturation(zoomed ? 1 : 0)
            .position(