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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:21:50+00:00 2026-06-10T15:21:50+00:00

I currently have a Container View Controller which is home to a button. When

  • 0

I currently have a Container View Controller which is home to a button. When this is pressed, I want the view to flip and grow, similar to iTunes on the iPad.

Main View Controller Layout:

enter image description here

Flipping the Container:

When the flip button is pressed, I intend to use this code (Inside the container view’s View Controller) to flip the container:

FrontVC *cb = [[FrontVC alloc]initWithFrame:CGRectMake(0, 0, 92, 65)];
FlipVC *cf = [[FlipVC alloc]initWithFrame:CGRectMake(0, 0, 92, 65)];

 [UIView transitionWithView:self.view
                  duration:1
                   options:UIViewAnimationOptionTransitionFlipFromLeft
                animations:^{

                    // Remove last view
                    for (UIView *subview in self.view.subviews) {
                        [subview removeFromSuperview];
                    }
                    [self.view addSubview:(displayingPrimary ? cb: cf)];

                }
                completion:^(BOOL finished) {
                    if (finished) {
                        displayingPrimary = !displayingPrimary;
                    }
                }];

This works well if the two views are the same size, and I can lay out the views using code. FrontVC and FlipVC are sub-classes of UIView.

I was thinking about doing something like this to move the view to the centre of the screen, but I’m stuck from there. Hey, I don’t even know if this would work! Is there a better way to do this?

if (!displayingPrimary) {
                        self.view.center = CGPointMake(320.0f, 480.0f);
                        cb.center = CGPointMake(320.0f, 480.0f);
                    }
                    else
                    {
                        self.view.center = CGPointMake(59, 324);
                    }

What I Am Aiming For:

Ideally, I would like to be able to design the flip view in storyboard, and have the ’tile’ grow, similar to iTunes:

iTunes Flip

Whereas in my example I would like it to look like this:

My Desired Outcome

How would I be able to design this in storyboard? If I try to make a view controller, I am unable to resize it to the size that I would like the flip size view controller to be.

  • 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-10T15:21:52+00:00Added an answer on June 10, 2026 at 3:21 pm

    The FlipView project is quite polished and looks exactly as the iTunes flip does. I used two imageViews for the demo project. The actual flip code is as follows:

    - (IBAction)flip
    {
        UIView *fromView, *toView;
        CGPoint pt;
        CGSize size;
        CGFloat sense;
    
        if(showingView == a) {
            fromView = a;
            toView = b;
            pt = BORIGIN;
            size = BRECT.size;
            sense = -1;
        } else {
            fromView = b;
            toView = a;
            pt = AORIGIN;
            size = ARECT.size;
            sense = 1;
        }
    
     [UIView animateWithDuration:TIME/2 animations:^
        {
            CATransform3D t = CATransform3DIdentity;
            t.m34 = M34;
            t = CATransform3DRotate(t, M_PI_2*sense, 0, 1, 0);
    
            containerView.layer.transform = t;
            containerView.frame = CRECT; // midpoint
            NSLog(@"Container MID Frame %@", NSStringFromCGRect(containerView.frame));
        }
        completion:^(BOOL isFinished)
        {
            toView.layer.transform = CATransform3DMakeRotation(M_PI*sense, 0, 1, 0);
            [UIView animateWithDuration:TIME/2 animations:^
                {
                    [fromView removeFromSuperview];
                    [containerView addSubview:toView];
    
                    CATransform3D t = CATransform3DIdentity;
                    t.m34 = M34;
                    t = CATransform3DRotate(t, M_PI*sense, 0, 1, 0);
    
                    containerView.layer.transform = t; //finish the flip
                    containerView.frame = (CGRect){ pt, size};
                } completion:^(BOOL isFinished)
                {
                        NSLog(@"Container Frame %@", NSStringFromCGRect(containerView.frame));
                        NSLog(@"A Frame %@", NSStringFromCGRect(b.frame));
                        NSLog(@"B Frame %@", NSStringFromCGRect(b.frame));
    
                        toView.layer.transform = CATransform3DIdentity;
                        containerView.layer.transform = CATransform3DIdentity;
                        showingView = showingView == a ? b : a;
                }];
        }];
    
    }
    

    http://dl.dropbox.com/u/60414145/FlipView.zip

    EDIT: One way to work around the resizing a real view with real controls in it might have is to take a snapshot of that view, use the snapshot while zooming/flipping, and in the final completion block switch out the image for the real view. That is:

    • create a UIImage of your current small view when the user taps the image
    • create a UIImage of the final view, rendered into a context as its natural size
    • use the two images in the container view, for the animation
    • in the final completion block, remove your imageView from view and put the second view now in self.view subviews
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Base-Controller from which all the controllers inherit. Currently this controller
I currently have a statement which reads if(Arrays.asList(results).contains(Word)); and I want to add at
In my controller i have an action which does not have a corresponding view.
I have implemented a custom split view controller which — in principle — works
I currently have a product view page that contains an MVCContrib HTML Grid with
I have a legacy Java servlet that is currently running in a Tomcat container.
I currently have a user's table which contains a one-to-one relationship for Youtube OAuth
We currently have an ant task that contains something similar to the following: <filelist
I have a Rails view (recipes/new) which allows users to enter a new recipe.
I have an ASP.NET MVC view which contains checkboxes for user-defined categories. <td><% foreach

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.