In an era of the seamless swipe navigation style apps, such as Snapchat, view controller management seems to be of importance. Some views could be fat, some could have large amounts of data populated to them. When building an iOS app that has 5-10 views sitting on a 2-dimensional surface (swipe left for view X, swipe down for view Y, swipe down again for view Z and so on), what are some best practices in handling these view controllers? I make the assumption that one wants to be able to do some kind of keyframe animations to UI elements in these views.
The plausible solutions that I can see are:
Add all of the view controllers to a 2d scroll view and selectively lock scroll direction
- Pros: Easy to setup, easy to to keyframe animations to subviews (using Jazzhands, for example)
- Cons: Need to keep many view controllers alive, potentially heavy on resources and long startup time.
Add view controllers to a 2d scroll view and selectively lock scroll direction, but only populate them when needed
- Pros: Could bring down startup time, also easy to to keyframe animations
- Cons: We still need to keep all view controllers alive
Use gesture driven view controller presentation animations
- Pros: We only need to keep the current view controller and its root view controllers alive
- Cons: More cumbersome to setup. Harder to perform keyframe animations based on scrolling. Could add lag when presenting big view controllers