1

Killing and relaunching iOS app, If I have View Controller A,B,C last visible View Controller was C. So now when I relaunch app i see View Controller C for 10 sec and then shows up Splash Screen. How can I avoid this.

Because of this first 10 sec User cant perform any event on app.

niravdesai21
  • 4,818
  • 3
  • 22
  • 33
  • Is your app completely closed before re-opening? have you been using restorationIdentifiers? – Scriptable Feb 22 '18 at 11:46
  • App is terminated manually and re opened, i get this issue. restorationIdentifiers are used only in UIPageViewController – niravdesai21 Feb 22 '18 at 12:10
  • sound like your clients are seeing the last snapshot image only; that is s static image only, presented while your app initing and the user cannot do any interaction on that static image. – holex Feb 22 '18 at 13:00
  • @holex exactly this screen stops interaction – niravdesai21 Feb 22 '18 at 14:02

2 Answers2

0

I think this is an operation system bug. But if you want to avoid this, you can try to add a splash screen image view before your app will go to background. You need to add your custom overlay view as subview to current window. Use this method to implement this feature: applicationDidEnterBackground. You can find more information about this feature here:

Display a view or splash screen before applicationDidEnterBackground (to avoid active view screenshot)

mikezs
  • 410
  • 1
  • 8
  • 16
0

To force iOS to launch an app with its default viewcontroller or launch image, you need to call

UIApplication.shared.ignoreSnapshotOnNextApplicationLaunch()

where you implement state preservation. Form the documentation : Documentation

Prevents the app from using the recent snapshot image during the next launch cycle.