2

My app has a feature that, when enabled, presents a “decoy” screen whenever the app is launched. The user then has to tap in a “secret knock” to dismiss the decoy screen and see the password screen.

The problem is, when the app is launched, a split second before the decoy screen is presented, the screen that was active before the app was suspended is shown. It’s shown for just a split second, but depending on what the user was previously doing, it can be awkward. Anyway, this little “glitch” practically defeats the whole purpose of the decoy screen.

The app is a free download, so if you have an iOS device, please download the app and activate the decoy feature on the options screen to see what I’m trying to say here.

And finally, to the question...

Is there a way to not have the app present the last active screen when it’s launched? I want the decoy screen to be the first thing to come up whenever the app is launched... without that split second of the previous content.

I know I can set the UIApplicationExitsOnSuspend to YES on the plist file to work around the problem. But that would force the app to quit and not suspend. I would really like to keep the suspend feature working.

Hope I made it clear enough...

Cezar
  • 55,636
  • 19
  • 86
  • 87
Spencer Müller Diniz
  • 1,318
  • 2
  • 14
  • 19

1 Answers1

1

You should implement

- (void)applicationDidEnterBackground:(UIApplication *)application

Inside this method you will do whatever you need to present the decoy screen on top of the last active screen.

For more information on this, check the documentation

Cezar
  • 55,636
  • 19
  • 86
  • 87
  • According to this excerpt from the documentation link you provided, this seems to be the answer: "You should perform any tasks relating to adjusting your user interface before this method exits but other tasks (such as saving state) should be moved to a concurrent dispatch queue or secondary thread as needed." I’ll try this out and come back to report on the results. Thanks. – Spencer Müller Diniz Feb 18 '13 at 15:51
  • 1
    Worked like a charm... Just submitted a new binary with the fix. Thanks! – Spencer Müller Diniz Feb 19 '13 at 12:42
  • This doesn't work for me, the screenshot is taken before my views update, so we still see the previous screen for a second at relaunch – Tancrede Chazallet Nov 05 '13 at 16:12