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

后端 未结 8 744
小鲜肉
小鲜肉 2020-11-27 15:40

I have confidential informations in my app, so I would like to hide them with a splash screen when the app is about to be moved to background.

I do run the app on iO

8条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 15:45

    Had the same issue, essentially I was using applicationDidEnterBackground to show a UIWindow on top of the content, but in iOS8 it didn't work as it did in iOS7.

    The solution I found was to create the UIWindow in applicationWillResignActive but make it hidden securityWindow.hidden = YES; and then in applicationDidEnterBackground all I would do would be to change securityWindow.hidden = NO.

    This seems to work exactly as iOS7 obscuring the content when multi tasking without affecting the view when using NotificationCenter or ControlPanel.

提交回复
热议问题