If I wanted to create an app with a scalable number of screens and animate between them, how could I best structure this? Last week I prototyped an app with maybe 30 screens with custom animations between them. At first, for each screen, I would have a setup, animateIn and animateOut functions. But the functions can vary depending on which screen you're animating from or to. This is where all complexity comes from. I ended up writing specific functions for animateScreen1toScreen2Out. I'd ideally like to use a state machine for variables, but it seems like I can only do this per layer and I'd need an array to keep track of each variable for each screen instead. Which makes code more complex in the end.