Home Ask Login Register

Developers Planet

Your answer is one click away!

Jarkerwastaken February 2016

App Minimized Function? Xcode - Swift

Just a quick question to ask how I can check if my app has been minimised? IE Home button been pressed?

Having a problem in my game where it's constantly building up more and more nodes at the top of the screen and I need to call the pause game function when the home button is pressed.

Thanks in advance

PS Xcode 6.4 -Swift


Roee84 February 2016

When the app goes to background, the function applicationDidEnterBackground in the appDelegate gets called (and then you have something like 5 seconds to clean stuff)

in addition, The system sends the UIApplicationDidEnterBackgroundNotification notification in addition to calling the applicationDidEnterBackground: method

so you can listen to this notification

Post Status

Asked in February 2016
Viewed 1,787 times
Voted 6
Answered 1 times


Leave an answer

Quote of the day: live life