app前后台切换信息的保护

切换后换上高斯模糊

iOS

@property (nonatomic, strong) UIVisualEffectView *backView;

- (void)applicationWillResignActive:(UIApplication *)application {
  UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
  backView = [[UIVisualEffectView alloc] initWithEffect:beffect];
  backView.frame = [self.window frame];
  [self.window addSubview:backView];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
  if (backView != nil) {
    [backView removeFromSuperview];
    backView = nil;
  }
}

你可能感兴趣的:(app前后台切换信息的保护)