I have a splash screen with a loading progress bar that shows complete upon API calls successful and dashboard loading complete. The screen then fades out via opacity animation to display the dashboard.
However, I want to remove the loading screen from the screen stack upon animation complete. When I try to remove the screen from the stack at the end of that method, the animation doesn't finish because it appears to remove it from the stack too soon.
I've experimented with the sleep() and wait() methods, but without much success. Has anyone tackled something similar where they needed to call a method after an animation was finished?