Skip to content

Instantly share code, notes, and snippets.

@alekseypotapov-dev
Last active April 18, 2021 10:03
Show Gist options
  • Save alekseypotapov-dev/1db8244284c15d19a741 to your computer and use it in GitHub Desktop.
Save alekseypotapov-dev/1db8244284c15d19a741 to your computer and use it in GitHub Desktop.
Blurring sensitive data
#pragma mark - Security
- (void)applicationDidEnterBackground:(UIApplication *)application {
RootViewController *rootVC = (RootViewController *)self.window.rootViewController;
UIViewController *viewController = (UIViewController *)[rootVC.presentedViewControllers lastObject];
/**
If the last presented view controller is a SplashViewController we must not present the splash
screen again.
*/
if (![viewController isKindOfClass:[SplashViewController class]]) {
/**
We're presenting a splash screen when the app backgrounds as a privacy and security feature.
This view needs to block the UI so that a screenshot of sensitive data does not accidentally
get saved to the background.
*/
[self presentSplashViewController];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment