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

  • Home
  • SEARCH
  • 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 6597925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:16:20+00:00 2026-05-25T18:16:20+00:00

My app has a tab bar with two different views. On the first tab,

  • 0

My app has a tab bar with two different views. On the first tab, its view has a continuously-looping animation.

When I click on the second tab, then go back to the first, the animation has stopped. I know I could start it again in a viewWillAppear: method, but the problem is bigger than that. Specifically, the animation will also stop if the app transitions to the background state, then moves back to the foreground. In that case, viewWillAppear is not called upon the foreground transition, so the viewWillAppear technique wouldn’t do anything.

What’s the best way to handle this situation?

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-05-25T18:16:21+00:00Added an answer on May 25, 2026 at 6:16 pm

    To maintain encapsulation, you rightly don’t want your AppDelegate to know which views need to resume animations. But you can have the view that contains the animation register for corresponding notification (for example in the view’s init method) and restart the animation on itself.

    [[NSNotificationCenter defaultCenter] 
       addObserver:self 
          selector:@selector(startAnimation) 
              name:UIApplicationWillEnterForegroundNotification  
            object:nil];
    

    …and don’t forget to deregister from the notification center in the dealloc method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a simple app tab-bar based application that has two views.
I have an app with a tab bar. Each tab has its own view
I have a tab bar app that has to display in different languages depending
My app has two distincts modes. There's a tab bar controller in the app
My iPhone app has a tab bar controller at the bottom of the view
I have a tab bar driven app. The app has some view controllers that
I have an app, which has a top navigation bar and a bottom tab
My iPhone app is a Tab Bar Application, which has 5 tabs. In each
I created an app with two different calculator views, each one with a separate
I have an app that has a tab bar & nav bar for normal

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.