As you said, "but the view manager, which was open before I pressed the home button, shows up for a moment."
The reason is not in the code, but in the iOS system. It captures a screenshot of the screen when the application is running in the background. As documented :
Remove confidential information from submissions before moving on to the background . When the application goes to the background, the system takes a snapshot of the main application window, which it then presents briefly when the application goes to the foreground. Prior to returning from your application the DidEnterBackground: method, you must hide or hide passwords and other confidential personal information that may be captured as part of the snapshot.
So, if the snapshot is deleted, it will directly show the new pushed view controller. (not sure about Apple's snapshot guide)
Update:
One approach might be: Add a black background to the application screen when it goes in the background (in the applicationDidEnterBackground method). Thus, it will show a black screen, returning to the application. {They store it to display a startup image for an already running application.}
Where does this help?
When we delete snapshots from the Preferences directory of the applicationโs sandbox (after the application is running in the background) and return to the application, it appears black for a while because it does not have a snapshot.
The result of our approach and the removal of the snapshot are the same.
Ravin source share