'Image movement & animation

How can I take a image on SplashView() and make it go to the top right hand corner on Home() view during the animation between the two?

SplashView()

 struct SplashView: View {
  // 1.
  @State var isActive:Bool = false

  var body: some View {
    VStack {
      // 2.
      if self.isActive {
        // 3.
        Home()
          .onAppear {
            print("IsVerificationSent: \(RequestedVerification)")
          }
      } else {
        // 4.
        Image("logo")
          .resizable()
          .scaledToFill()
          .frame(width: 200, height: 200)
          .overlay {
            RoundedRectangle(cornerRadius: 30)
              .stroke(.white, lineWidth: 1)
          }
          .shadow(color: Color.black.opacity(0.5), radius: 7)
      }
    }
    // 5.
    .onAppear {
      // 6.
      DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
        // 7.
        withAnimation {
          self.isActive = true
        }
      }
    }
  }

}

Home()

struct Home: View {
    var body: some View {
      VStack {
            Image("logo")
              .resizable()
              .scaledToFill()
              .offset(y: 25)
              .frame(width: 50, height: 50)
              .overlay {
                RoundedRectangle(cornerRadius: 10)
                  .stroke(.white, lineWidth: 1)
                  .offset(y: 25)
              }
              .shadow(radius: 2)
        Spacer(minLength: 0)
      }
  }
}

And since I can't put the full Home() view on here, how can I go about adjusting to make it look the best possible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source