This is my code:
import SwiftUI
@main
struct BouncingApp: App {
var body: some Scene {
WindowGroup {
BounceAble()
}
}
}
struct BounceAble: View {
@State var bounce: Bool = false
var body: some View {
VStack(alignment: .center) {
Button("Bounce") {
withAnimation(.easeOut) {
bounce.toggle()
}
}
}
.overlay {
if bounce {
Circle()
.frame(width: 200, height: 200)
.transition(.slide)
.transition(.scale)
.onTapGesture {
withAnimation(.easeIn) {
bounce.toggle()
}
}
}
}
}
}
The problem is i want my Circle to slide while growing at the same time. I thought adding two transitions at a time would does the job but it did not. is there any logical problem with my code? thank you so much.