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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:10:38+00:00 2026-05-28T18:10:38+00:00

[UIView animateWithDuration:1.0 animations:^(void) { im.transform = CGAffineTransformIdentity; } completion:^(BOOL finished) { [UIView animateWithDuration:1.0 delay:1.0

  • 0
[UIView animateWithDuration:1.0 animations:^(void) {
    im.transform = CGAffineTransformIdentity;
} completion:^(BOOL finished) {
    [UIView animateWithDuration:1.0 delay:1.0 options:UIViewAnimationCurveEaseOut animations:^(void) {
        im.alpha = 0.0;
    } completion:^(BOOL finished) {
        [im removeFromSuperview];
    }];    
}];

The code is for animating UIImageView, that I know;
I want to know the calling mechanism, as I haven’t seen this kind of function call for the very first time.

Mainly, What is ^(void) and why im.transform = CGAffineTransformIdentity; passed to it?

I have gone thorugh Apple docs, to find anything related to this function call, and I got it too, but I didn’t get any idea from there; or I might have been to wrong section.

Can anyone here guide me to this?

  • 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-28T18:10:39+00:00Added an answer on May 28, 2026 at 6:10 pm

    This is called a block, and was introduced in iOS 4 and Mac OS X 10.6.

    Here are some links where you can learn more about them:

    • Apple’s Documentation – Blocks Programming Topics
    • Ask Big Nerd Ranch: Blocks in Objective-C
    • Programming with C Blocks
    • Introduction to Blocks in Objective-C – Part 1

    The above example should read as follows:

    // Start an animation over the next 1 second 
    [UIView animateWithDuration:1.0 animations:^(void) {
    
        // For this animation, animate from the current value of im.transform back to the identity transform
        im.transform = CGAffineTransformIdentity;
    
    } completion:^(BOOL finished) {  // At the completion of the first animation...
    
        // Wait 1 second, then start another 1-second long animation
        [UIView animateWithDuration:1.0 delay:1.0 options:UIViewAnimationCurveEaseOut animations:^(void) {
    
            im.alpha = 0.0;  // Fade out im during this animation
    
        } completion:^(BOOL finished) {  // When you complete this second animation
            [im removeFromSuperview];  // Remove im from its superview
        }];    
    }];
    

    So you will have one second where im animates the removal of its transform, a one second delay, and then a one second fadeout of im.

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

Sidebar

Related Questions

I have this code: [UIView animateWithDuration:0.8 animations:^{ [self methodToRun]; } completion:^(BOOL finished){ [self anotherMethod];
I'm using UIView's + animateWithDuration:delay:options:animations:completion: method to move my view along a line over
This code: [UIView animateWithDuration:0.25f animations:^() { self.view.alpha = 1.0f; }]; is generating this compile
I have the following block-based animation: [UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionCurveEaseInOut animations:^{ [view.layer setTransform:CATransform3DMakeScale(1.3f, 1.3f,
I experience a strange problem with iPhone animation blocks. This code: [UIView animateWithDuration:2 delay:
- (void) startLoading { [self blink]; } - (void) blink { [UIView animateWithDuration:0.5 delay:
I'm animating a Bar (change the height) with UIView animation block [UIView animateWithDuration:(NSTimeInterval) animations:^(void)animations]
I would like to write a method similar to this: +(void)myMethodWithView:(UIView *)exampleView completion:(void (^)(BOOL
for(UIView *subview in [scrollView subviews]) { NSLog(@subviews Count=%d,[[scrollView subviews]count]); //[subview release]; [subview removeFromSuperview]; }
In my app when I am switching views with an animation using UIView animations,

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.