iOS: Hiding sensitive information on the screen when app is backgrounded

感情迁移 提交于 2019-12-05 07:19:04

Not sure about HIPAA's requirements about backgrounding and possibly leaving the user logged in for someone else to resume, but the safest sounds like it would be to add a key UIApplicationExitsOnSuspend with a boolean value of YES to info.plist.

That will prevent the app from backgrounding entirely, and restarts it (possibly triggering a login procedure) every time you go back to it.

Most (if not all) mobile banking applications I've tested do this for safety reasons.

I believe the answer is to not concern oneself with changing what's on the screen before the backgrounding animation begins, but to simply modify what's displayed on the screen once the app enters the background (i.e. inside of applicationDidEnterBackground: in your App Delegate.) This solved my problem.

My UIImageView overlay idea worked here, although I decided just to pop to the root view controller instead. Simpler that way. My root view doesn't have any sensitive info.

Here's what it looks like:

-(void)applicationDidEnterBackground:(UIApplication *)application {

    UINavigationController *navigationController = 
        (UINavigationController *)self.window.rootViewController;
    [navigationController popToRootViewControllerAnimated:NO];

    ...
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!