0

How can I check if someone has touched the iPhone home button during gameplay?

I want to run some code before the iPhone switches from my game to the iPhone home screen.

Rob
  • 26,989
  • 16
  • 82
  • 98
JohnDark0
  • 35
  • 5
  • 1
    See the willResignActive notification: https://developer.xamarin.com/api/member/MonoTouch.UIKit.UIApplication+Notifications.ObserveWillResignActive/p/System.EventHandler{MonoTouch.Foundation.NSNotificationEventArgs}/ – Ignacy Debicki Jan 12 '17 at 23:58
  • Take a look [here](http://stackoverflow.com/questions/6650717/when-an-ios-application-goes-to-the-background-are-lengthy-tasks-paused) - You'll need to handle `applicationWillResignActive` rather than checking that the button is pressed – Rob Jan 12 '17 at 23:58
  • Thanx. I found out that I can use Game.Deactivated and Game.Activated in MonoGame. – JohnDark0 Jan 13 '17 at 23:52

0 Answers0