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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:36:05+00:00 2026-05-23T19:36:05+00:00

The following code is a method I created inside a UIViewController to popup/down a

  • 0

The following code is a method I created inside a UIViewController to popup/down a “reader” overlay on top of the controller’s own view. The intention is for the reader to begin as transparent, size zero, at a specific point. “Popup” is then animated as increasing in opacity and size, and shifts towards an application frame central position. “Popdown” is subsequently animated as the reverse, shrinking back whilst moving toward a specified location, fading out.

The popup code works exactly as desired. However, the popdown version (i.e. code executed if isPopup == NO) immediately changes the bounds rather than doing so gradually. Thus the popdown animation shows from the beginning a 1 pixel square view moving towards its destination and fading out.

-(void)popupReader:(BOOL)isPopup from:(CGPoint)loc  {
    CGFloat newAlpha = 0.0f;
    CGPoint newCenter = CGPointZero;
    CGRect newBounds = CGRectZero;
    CGRect appFrame = [UIScreen mainScreen].applicationFrame;

    CGSize readerSize = [self viewSize];
    if (isPopup) {
        newAlpha = 1.0f;
        newCenter = CGPointMake(appFrame.origin.x+appFrame.size.width/2,
                                appFrame.origin.y+appFrame.size.height/2);
        newBounds = CGRectMake(0,0,readerSize.width,readerSize.height);

        [self.view setAlpha:0.0f];
        [self.view setCenter:loc];
        [self.view setBounds:CGRectMake(0, 0, 0, 0)];
    } else {
        newCenter = loc;
        newBounds = CGRectMake(0,0,1,1);
    }

    const CGFloat animDur = 0.3f;    
    [UIView transitionWithView:self.view 
                      duration:animDur
                       options:UIViewAnimationOptionTransitionNone|UIViewAnimationOptionCurveEaseOut 
                    animations:^{
      self.view.alpha = newAlpha; 
      self.view.center = newCenter; 
      self.view.bounds = newBounds;
      } 
         completion:nil];
}

I’ve already tried animating just the frame, rather than bounds and center, but the result was identical.

Does anyone know why this is happening, and how I can overcome this problem?

Many thanks for your time.

  • 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-23T19:36:05+00:00Added an answer on May 23, 2026 at 7:36 pm

    from the docs:

    UIViewAnimationOptionTransitionNone –
    An option for specifying that no transition should occur.

    try one of:

    UIViewAnimationOptionTransitionFlipFromLeft 
    UIViewAnimationOptionTransitionFlipFromRight 
    UIViewAnimationOptionTransitionCurlUp          
    UIViewAnimationOptionTransitionCurlDown       
    

    Edit:
    Or if you’re just looking to animate those values, try

    [UIView animateWithDuration:(NSTimeInterval)duration 
                     animations:(void (^)(void))animations 
                     completion:(void (^)(BOOL finished))completion];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following code snippet from inside a method; NSBezierPath * tempPath = [NSBezierPath
I have the following code inside a method: var list = new[] { new
I am having difficulty with the following code which is inside a static method
Hallo, I have following jquery code for calling ASP.NET MVC controller method that is
I have the following code inside main method: List<Rectangle> rects = new List<Rectangle>(); for
I have a method that contains the following (Java) code: doSomeThings(); doSomeOtherThings(); doSomeThings() creates
I have the following code (calling a method returning IEnumerable): FibonacciWithLinq.Skip(delegate() { return 5;
The following code examines the behaviour of the float() method when fed a non-ascii
The following code says that passing the map as const into the operator[] method
In the ContainsIngredients method in the following code, is it possible to cache the

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.