Whenever I load a resized image into a 70 by 70 frame, when I run the loading screen on the simulator, it looks like the image is flying from the top left corner of the screen on load, however, when I load it in the previews, it starts where its supposed to be in the center. Both are scaled properly, however, the first ones position is acting like I put a transition on it when I did not
import SwiftUI
struct LoadingView: View {
@Environment(\.colorScheme) private var colorScheme
var text: String? = nil
@State private var isSpinning = false
var body: some View {
VStack{
Image("Jeromes_Logo")
.resizable()
.frame(width: 70, height: 70)
.rotationEffect(.degrees(isSpinning ? 360 : 0))
.animation(
.bouncy(duration: 0.4, extraBounce: 0.2)
.repeatForever(autoreverses: false),
value: isSpinning
)
.onAppear {
isSpinning = true
}
if let text = text {
Text(text)
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
#Preview {
LoadingView(text: "loading")
}