To restart the application from the main screen, and not from the screen that we left on

When we play our application on the device (ios 4.0 and above) and leave the average work sequence and return later, we return the average work process. I want it to not play from the same left point, and the main screen should load (i.e. the same thing that happens when viewDidLoad is called by our rootViewController).

Please give suggestions if possible, and if not, indicate the reason for this.

+3
source share
3 answers

In an alternative approach, turn off the background mode and restart the application each time it comes to the fore: add the UIApplicationExitsOnSuspend key to your info.plist application and set it to YES.

UIApplicationExitsOnSuspend

UIApplicationExitsOnSuspend (Boolean - iOS) , , , . , SDK iOS 4.0 YES, . YES, . , , .

iOS 4.0 .

+7

, "", ? i.e ?
UIApplicationExitsOnSuspend

+1

Yes, you call your rootviewcontroller from applicationDidUnhide to do this. You will have to twist your logic a bit (for this method call you need to reset your variables).

Edit: you should use applicationDidBecomeActive instead . The link is located at the same link.

0
source

Source: https://habr.com/ru/post/1787619/


All Articles