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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:53:54+00:00 2026-06-12T04:53:54+00:00

I have a custom view which I present with animation giving a bouncing effect.

  • 0

I have a custom view which I present with animation giving a bouncing effect. Now, I want it to disappear in the similar fashion like shrink and then disappear.

The below piece of code to present my view with a bouncing effect is working fine:

self.componentDetailController.view.center = iGestureRecognizer.view.center;
self.componentDetailController.view.alpha = 0.0;
self.componentDetailController.view.transform = CGAffineTransformMakeScale(0.01, 0.01);

 [UIView animateWithDuration:(0.2) animations:^{
     self.componentDetailController.view.center = CGPointMake(kScreenWidth / 2, kScreenHeight / 2);
     self.componentDetailController.view.alpha = 0.5;
     self.componentDetailController.view.transform = CGAffineTransformMakeScale(1.05, 1.05);
 } completion:^(BOOL iFinished) {
     [UIView animateWithDuration:(0.1) animations:^{
         self.componentDetailController.view.alpha = 0.90;
         self.componentDetailController.view.center = CGPointMake(kScreenWidth / 2, kScreenHeight / 2);
         self.componentDetailController.view.transform = CGAffineTransformMakeScale(0.98, 0.98);
     } completion:^(BOOL iFinished) {
         self.componentDetailController.view.alpha = 1.0;
         self.componentDetailController.view.transform = CGAffineTransformMakeScale(1.0, 1.0);
         self.componentDetailController.view.transform = CGAffineTransformIdentity;
     }];
 }];

I have written the below piece of code to shrink and dismiss the view which is not working. It brings the view to the front a little but then does not dismiss it. Any clue what is wrong here:

 - (void)cancelButtonPressed {
    self.componentDetailController.view.transform = CGAffineTransformIdentity;
    [UIView animateWithDuration:(0.1) animations:^{
        self.componentDetailController.view.alpha = 1.0;
        self.componentDetailController.view.transform = CGAffineTransformMakeScale(1.05, 1.05);
    } completion:^(BOOL iFinished) {
        [UIView animateWithDuration:(0.4) animations:^{
            self.componentDetailController.view.center = self.tappedComponentView.center;
            self.componentDetailController.view.transform = CGAffineTransformMakeScale(0.01, 0.01);
            self.componentDetailController.view.backgroundColor = [UIColor clearColor];
            self.componentDetailController.view.alpha = 0.0;
        } completion:^(BOOL iFinished) {
            [self.componentDetailController.view removeFromSuperview];
        }];
    }];

    self.componentDetailController = nil;
    [self enableBackView];
}

Here, self.tappedComponentView.center is same as self.tappedComponentView.center.

  • 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-12T04:53:56+00:00Added an answer on June 12, 2026 at 4:53 am

    The +animateWithDuration:animations:completion: call returns immediately, so as soon as the second animation runs, self.componentDetailController is nil and all the subsequent view-transformation calls go nowhere. Store self.componentDetailController.view into its own variable and reference that in your animation blocks. E.g.:

    UIView *detailView = self.componentDetailController.view;
    detailView.transform = CGAffineTransformIdentity;
    [UIView animateWithDuration:0.1 animations:^{
        detailView.alpha = 1;
    // …
    }];
    
    self.componentDetailController = nil;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom view with several NSTextField controls for which I want to
I have a custom view which I would like to look like a UINavigationBar.
I have a custom view which has a piano keyboard drawn inside of it.
Please help me to turn off user interaction. I have a custom view which
In my custom View which I have added to my viewControllers's view, I need
I have two helper methods inside a custom View which are called by their
I have a view with two subviews: A UIImageView A small Custom View which
I have a GridView in which each row has a custom view. The grid
I have view on which I defined a custom tagName. I need to be
I have a custom component which consists of 2 text view and 4 toggle

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.