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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:20:24+00:00 2026-06-08T01:20:24+00:00

I am trying to slide in a UIView while also rotating it. The end

  • 0

I am trying to slide in a UIView while also rotating it. The end result is basically a UIView that zips across the screen rotating about 70 degrees to the left, hits the edge, rotates about 50 degrees to the right, and finally ends up being still (after a few more wobbles). I am able to get it sliding and rotating, but when I try to animate the second rotation (once it hits the edge), the frame goes back to the original value (back to the left of the screen). How do I get the frame to stick once the UIView has slid across?

[UIView animateWithDuration:.4 delay:0.0 
                    options:UIViewAnimationCurveEaseInOut
                 animations:^{
                     CGAffineTransform slideAndRotate = CGAffineTransformMakeTranslation(300, 0);
                     slideAndRotate = CGAffineTransformRotate(slideAndRotate, RADIANS(75));

                     self.ticketImageView.transform = slideAndRotate;                 
} completion:^(BOOL finished) {
    // set the frame to the location where it ended up
    NSLog(@"%@", NSStringFromCGRect(self.ticketImageView.frame));
    [UIView animateWithDuration:.35 
                          delay:0.05 
                        options:UIViewAnimationCurveEaseInOut 
     | UIViewAnimationOptionBeginFromCurrentState
                     animations:^{
                         CGAffineTransform rightAngle1 = 
                         CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(-45.0));
                         [[self ticketImageView] setTransform:rightAngle1];
    } completion:^(BOOL finished) {

    }];
  • 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-08T01:20:26+00:00Added an answer on June 8, 2026 at 1:20 am

    In your first animation block, you are creating transform that includes both a translation and a rotation. In your second animation block, you are creating a transform that includes a rotation but not a translation. So your view is no longer translated when you animate to the second transform.

    I see that you have used the UIViewAnimationOptionBeginFromCurrentState option. You might think this option makes the second transform stack with the first, but it doesn’t. The second transform replaces the first, regardless of the option.

    A UIView has two properties that affect its location. One is transform, which you are using. The other is center.

    Usually we use the center property to move a view around, and only use the transform property to rotate and scale the view. I recommend you do the same.

    Since you say you want the view to wobble a few more times, I suggest you try something like this:

    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
    
        [UIView animateWithDuration:0.4 animations:^{
            self.ticketImageView.center = CGPointMake(180, self.ticketImageView.center.y);
        }];
    
        [self wobbleWithAmount:0.4 direction:1];
    }
    
    - (void)wobbleWithAmount:(CGFloat)amount direction:(CGFloat)direction {
        [UIView animateWithDuration:amount animations:^{
            self.ticketImageView.transform = CGAffineTransformMakeRotation(amount * direction * M_PI * 0.5f);
        } completion:^(BOOL finished) {
            if (amount > 0.05f) {
                [self wobbleWithAmount:amount * 0.5f direction:-direction];
            } else {
                [UIView animateWithDuration:amount * 0.5f animations:^{
                    self.ticketImageView.transform = CGAffineTransformIdentity;
                }];
            }
        }];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Eventually I'm trying to create a timed slide show that fades images in and
I'm trying to have a UIPickerView slide from the bottom of the screen (over
I'm trying to animate a UIView to slide left and right. What I've tried
I'm trying to let a user draw lines on multiple UIView canvases that are
I am trying to slide a Panel from the bottom, so that it covers
I am trying to slide down a sub menu when hovering over a#about and
I'm trying to slide a UIImageView into a UIView, and fade it in at
I'n trying to create a simple slide panel that slides in from the bottom
I'm trying to get the slide animation that occurs with a UINavigationController . All
I am trying to write a very simple slide up and slide function that

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.