Explore Library
Quiz

View Controller Focus & Cleanup

Understanding where to subscribe and clean up around a view controller gaining and losing screen focus.

In a UIViewController, you want to start observing a live data feed each time the screen becomes visible and stop observing when it leaves the screen (e.g. when the user pushes another VC on top). Which pair of methods should you use?