How to detect when your app moves to the background or foreground with scenePhase

Ben Fox @fox