Post

Replies

Boosts

Views

Activity

Transition to another view with a delay
Hi. Sorry if my English is not very good. I'm trying to go to the main screen after the splash screen. But when moving from it to the main screen, I have problems with animation. How to fix this, or how to make a delay to go to an already loaded screen. GIF with problem. https://gifyu.com/image/ShHtr struct SplashScreen: View {     @State var isActive = false     @State var startDegrees = -10.0          var body: some View {         if isActive {             MainView()         } else {             VStack {                 VStack {                     Image("logo")                         .resizable()                         .frame(width: 140, height: 200)                         .rotationEffect(.degrees(startDegrees))                     Text ("SUSHI   PIZZA")                         .font(.custom("Noteworthy", size: 30))                 }                 .onAppear {                     withAnimation(.interpolatingSpring(stiffness: 10, damping: 0)) {                         self.startDegrees = 0.0                     }                 }             }.onAppear {                 DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {                     self.isActive = true                 }             }         }     } }
0
0
319
Nov ’22