Coming back from suspended state - iOS

2.4k views Asked by At

When my app comes back from a suspended state is behaving in a very strange way, so I would like to restart it from scratch in this situation.

But I don't want to restart it every time it enters the background and comes back to the foreground.

Is it possible to know if the app comes back from a suspended state or if it was just a background state?

Thanx in advance!

1

There are 1 answers

0
Gordon Dove On

I believe that the short answer to this is No.

Apple's state documentation isn't explicit, but I would argue that the documentation implies that didEnterBackground is called in this situation, as it states that there are methods associated with each transition, but it isn't explicit, so I tested.

I wrote a short test program that uses region monitoring to force an app to transition from suspended to background. This isn't definitive, as it is also difficult to know if an app has transitioned from background to suspended, but after a couple of minutes, apps should be in suspended unless they're using background modes or tasks. Firing the region change ( through the debugger), I got didExtRegion callback, but no didEnterBackground.