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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:37:43+00:00 2026-06-11T05:37:43+00:00

i have iPad application with splitViewController and tableViewController in splitViewDetailController. i would like to

  • 0

i have iPad application with splitViewController and tableViewController in splitViewDetailController.
i would like to show detailViewController (with UIModalPresentationFormSheet), after click on tableCell, with custom animation. The animation shoud be vertical rotation of tableViewCell and rotating cell should transform into detailViewController view. The whole animation should look like animation in iTunes podcast.

Here’s the code of my animation:

CGRect rectInCell = [[self.cellView superview] convertRect:self.cellView.frame toView:cell];
CGRect rectInTableView = [self.tableView rectForRowAtIndexPath:[self.tableView indexPathForCell:cell]];
CGRect rectInSuperview = [self.tableView convertRect:rectInTableView toView:[[[APP_DELEGATE window] subviews] lastObject]];

CGRect imgRect = CGRectMake(rectInSuperview.origin.x+rectInCell.origin.x, rectInSuperview.origin.y+rectInCell.origin.y, rectInCell.size.width, rectInCell.size.height);

self.originalRelativeFrame = imgRect;
self.originalFrame      = self.cellView.frame;
self.originalSuperview  = self.cellView.superview;
self.originalTransform  = self.cellView.transform;

[self.cellView setFrame:imgRect];
if (self.whiteView == nil) {
    self.whiteView = [[UIView alloc] init];
    [self.whiteView setBackgroundColor:[UIColor whiteColor]];
}
[self.whiteView setFrame:imgRect];
[self.whiteView setAlpha:0];

self.cellView.layer.zPosition = self.cellView.frame.size.width;
self.whiteView.layer.zPosition = self.cellView.frame.size.width;

[[[[APP_DELEGATE window] subviews] lastObject] addSubview:self.whiteView];
[[[[APP_DELEGATE window] subviews] lastObject] addSubview:self.cellView];


CATransform3D rotation = CATransform3DMakeRotation(M_PI/2, 0, 1, 0);
CATransform3D scale = CATransform3DMakeScale(1.5,1.5,1);//(540.0/self.cellView.bounds.size.width, 620.0/self.cellView.bounds.size.height, 1);
CGPoint finCent = CGPointMake([[[[APP_DELEGATE window] subviews] lastObject] bounds].size.width/2.0, [[[[APP_DELEGATE window] subviews] lastObject] bounds].size.height/2.0);
//(finCent.x > self.cellView.center.x) ? (finCent.x - self.cellView.center.x) : (self.cellView.center.x - finCent.x);
CGPoint center = CGPointMake((self.cellView.center.x - finCent.x) / 2.0 ,(self.cellView.center.y - finCent.y )/2.0);

[UIView animateWithDuration:ANIMATION_DURATION_HALF delay:0 options:UIViewAnimationOptionCurveEaseOut
                 animations:^{

                     [self.cellView.layer setTransform:CATransform3DConcat(scale, rotation)];
                     [self.cellView setCenter:CGPointMake(self.cellView.center.x - center.x, self.cellView.center.y - center.y)];
                     //[self.cellView setAlpha:0];

                     [self.whiteView.layer setTransform:CATransform3DConcat(scale, rotation)];
                     [self.whiteView setCenter:CGPointMake(self.whiteView.center.x - center.x, self.whiteView.center.y - center.y)];
                     //[self.whiteView setAlpha:1];

                     [self.blackView setAlpha:0.3];

                 }
                 completion:^(BOOL finished) {

                     [self.whiteView setAlpha:1];
                     [self.cellView setAlpha:0];

                     [UIView animateWithDuration:ANIMATION_DURATION_HALF delay:0 options:UIViewAnimationOptionCurveLinear
                                      animations:^{

                                          CATransform3D rotation = CATransform3DMakeRotation(M_PI, 0, 1, 0);
                                          CATransform3D scale = CATransform3DMakeScale(540.0/self.cellView.bounds.size.width, 620.0/self.cellView.bounds.size.height, 1);
                                          CGPoint finCent = CGPointMake([[[[APP_DELEGATE window] subviews] lastObject] bounds].size.width/2.0, [[[[APP_DELEGATE window] subviews] lastObject] bounds].size.height/2.0);

                                          [self.cellView.layer setTransform:CATransform3DConcat(scale, rotation)];
                                          [self.cellView setCenter:finCent];

                                          [self.whiteView.layer setTransform:CATransform3DConcat(scale, rotation)];
                                          [self.whiteView setCenter:finCent];

                                      }
                                      completion:^(BOOL finished) {

                                          [self presentModalViewController:self.modalCtrl animated:YES];


                                      }];

                 }];

But the problem is rotation of application. After rotating application whiteView behind my detailViewController dosn’t stay centered in the middle of window.

Any idea how can i fix this issue?

  • 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-11T05:37:44+00:00Added an answer on June 11, 2026 at 5:37 am

    You should rearrange the layout of your views when the user rotates the device.

    The UIViewController class offers a couple of methods to deal with this:

    – willRotateToInterfaceOrientation:duration:
    – willAnimateRotationToInterfaceOrientation:duration:
    – didRotateFromInterfaceOrientation:
    

    Have a look at UIViewController reference.

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
                                duration:(NSTimeInterval)duration {
    
           CGRect imgRect = <CALC YOUR NEW FRAME HERE TO ACCOUNT FOR THE DEVICE ORIENTATION>;
           [self.whiteView setFrame:imgRect];
    }
    

    When calculating the new frame, you can use the toInterfaceOrientation argument to know for which orientation. Another option you have that might make things simpler is defining the view center.

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

Sidebar

Related Questions

For my ipad application i have requirement like this For each row in root
In one of the iPad Application, I am working I have added custom views
I have an iPad application with a SplitViewController. I am hiding the left hand
I have an iPad SplitViewController application with the following features: master (left hand) view
I have an iPad SplitViewController application in which I hide the left pane in
I have created a simple iPad application based on the UISplitViewController template. I'd like
I have an iPad application with a SplitViewController in which the DetailView has a
I have ipad application which has 3 tableviews with holds data like label,image,property lists
I have an iPad application with a custom file type declared via UTI and
I have an iPad application that pulls in all of its data from an

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.