0

I have code like this in my ContentView:

I want to make this transition slow than now, it looks like this right know, but animation is too fast. I don't know how to do it. Type of AnyTransition doesn't have something like value or duration methods.

How it's look?: GIF from Simulator

struct ContentView: View {
        
    @EnvironmentObject var session: SessionManager

    
    var body: some View {
        ZStack {
            switch session.currentState {
            case .loggedIn:
                TabBar()
                    .transition(.move(edge: .bottom))
            case .onboardingSetup:
                OnboardingSetupView(action: session.completeOnboardingSetup)
                    .animation(.easeInOut, value: 0.5)
            case .onboarding:
                OnboardingView(action: session.completeOnboarding)
                    .transition(
                        .move(edge: .bottom)
                    )
            default:
                ProgressView()
            }
        }
        .animation(.easeInOut, value: session.currentState)
        .onAppear(perform: session.configureCurrentState)
    }
}

I tried to use .animation, but still i can't add duration to this code:

  case .onboarding:
                OnboardingView(action: session.completeOnboarding)
                    .transition(
                        .move(edge: .bottom)
                    )

0 Answers0