How can I call applicationDidEnterBackground
that in AppDelegate
from a viewController
?
I want to run a function in the background of the app without pressing home button.
You are not supposed to call that function from anywhere. It is there to let you know when the app enters the background.
Do you simply want to know when the app enters the background? If so, then you can create a notification to help you with that:
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(handleEnteredBackground:)
name: UIApplicationDidEnterBackgroundNotification
object: nil];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With