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 8486981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:06:17+00:00 2026-06-10T21:06:17+00:00

I have few subviews responding to the same animation. I want remove the the

  • 0

I have few subviews responding to the same animation. I want remove the the subview after the animations has finish (animationDidStop ). Is a way to detect what subview was animated in animationDidStop ?

in this particular case:

 if ([animationID isEqualToString:@"myAnimation"])
    view.removeSubView:myView;

how do you if is the correct subview?, because I as I said before some of the subviews respond to the same animation.

  • 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-10T21:06:18+00:00Added an answer on June 10, 2026 at 9:06 pm

    You can name your animations (each view will require a unique animation name):

    [UIView beginAnimations:@"myAnimation" context:nil];
    myView.alpha = 1.0f;     // or whatever property you're animating...
    [UIView commitAnimations];
    

    and then retrieve this name in

    - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(id)context
    {
        if ([finished boolValue])
        {
            if ([animationID isEqualToString:@"myAnimation"])
                [myView removeFromSuperview];
        }
    }
    

    or better yet, use the iOS4+ block animation method and its completion handler, you’ll be able to much more cleanly reference the view being animated right in the completion handler. e.g.

    [UIView animateWithDuration:0.4f animations:^
    { 
        myView.alpha=1.0f; 
    } 
    completion:^(BOOL finished)
    {
        [myView removeFromSuperview];
    }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to release uiimage/view/subviews when I want, and have a few questions regarding
In my view I have few subviews. This is UIImageView. Each UIImageView contain image
I have a View with few subviews in it and I draw some sublayers
I have a Controller of which I have a few subviews. At a certain
I have a UISearchBar as a subview of a UIViewController's view. The UIViewController has
I have a UIView with a shadow and a UIImageView subview. I want to
I have a UIPickerView as subview in a UITableViewController, which I want to slide
I have an NSView (lets call it mainview) with a few subviews. One of
My application has a few portions that have really big buttons (640x130, 230x150, etc.)
I have few tabs and I need to way to access textboxes on them

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.