Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:32:33+00:00 2026-06-11T21:32:33+00:00

When a foreground app gets backgrounded (e.g. Home button gets pressed), how can I

  • 0

When a foreground app gets backgrounded (e.g. Home button gets pressed), how can I change elements on the topmost view controller prior to when iOS takes a snapshot of it and starts the animation to show the next screen?

I ask because I’m writing an app requiring HIPAA compliance, and I am concerned that the snapshot that the OS takes in order to do this animation sometimes contains sensitive data which should not be visible even for a split second when the app gets foregrounded later.

I’m aware that view controllers have lifecycle methods such as viewWillDisappear which might be usable, but I have a lot of controllers and I’d rather just have something in my App Delegate to handle this (e.g. by adding an opaque full-screen UIImageView overlay) rather than having to write custom code for this in every last controller.

I tried putting overlay-generating code in applicationWillResignActive, and I’ve been digging with Apple’s docs and Google, but it’s not working. I suspect the screenshot gets taken before the app has a chance to update the screen.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:32:34+00:00Added an answer on June 11, 2026 at 9:32 pm

    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];
    
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to present a Modal View Controller when the app enters in foreground..
How to use mutex for a database sync between background agent and foreground app?
My app is a background service running in the foreground. In low memory situations
Why does this trigger work (Changing the foreground of the button to Red when
I am using an animation to change the background and foreground color of a
I'm writing an app that has a foreground service, content provider, and a Activity
I have a background agent and a foreground app on Windows Phone Mango. (These
Alt+Tab is used to switch a windows app to foreground, does anyone know how
My App is typically run overnight as a baby monitor, either as foreground app,
I add this function to post a notification when the app enter foreground: -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.