SwiftUI: Unexpected Delay in Animation on iPhone 13 Pro Max when using GeometryReader
I'm experiencing an unexpected delay in animations when using a `GeometryReader` for layout in my SwiftUI app on the iPhone 13 Pro Max. The animation is supposed to smoothly transition the opacity and scale of a view, but it seems to lag significantly. Here's the relevant code snippet: ```swift struct AnimatedView: View { @State private var isAnimated = false var body: some View { GeometryReader { geometry in VStack { Text("Hello, World!") .font(.largeTitle) .opacity(isAnimated ? 1 : 0) .scaleEffect(isAnimated ? 1 : 0.5) .animation(.easeInOut(duration: 0.5), value: isAnimated) .onAppear { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { isAnimated.toggle() } } } .frame(width: geometry.size.width, height: geometry.size.height) } } } ``` I’ve tried adjusting the animation duration and using `.animation(nil)` before the state change to see if that would help, but the delay persists. I also profiled my app using Instruments, and while the CPU usage seems fine, I noticed that the frame updates during the animation seem choppy, especially on larger views. Is the `GeometryReader` causing the performance issues? Are there any best practices for animating views within a `GeometryReader` that I might be overlooking? Any insights would be greatly appreciated! I'm working in a Ubuntu 22.04 environment. Thanks for any help you can provide!