title: I want to use animation to imageview using UIanimationtransitioncurl right or left. Is it possible?
body: <p>I want to animate my photo gallery like the pages of the book.
  Is there any method with that I can use UIanimationtransitioncurl in either the left or right side?</p>
  
  <p>This is the code as you have suggested to me. I have done the allocation on the viewdidload method.</p>
  
  <pre><code>self.title = @"TransitionsTitle";
  
  // Create the container view which we will use for transition animation (centered horizontally).
  CGRect frame = CGRectMake(round((self.view.bounds.size.width - kImageWidth) / 2.0),
                                                      kTopPlacement, kImageWidth, kImageHeight);
  self.containerView = [[[UIView alloc] initWithFrame:frame] autorelease];
  [self.view addSubview:self.containerView];
  
  // The container view can represent the images for accessibility.
  [self.containerView setIsAccessibilityElement:YES];
  [self.containerView setAccessibilityLabel:NSLocalizedString(@"ImagesTitle", @"")];
  
  // Create the initial image view.
  frame = CGRectMake(0.0, 0.0, kImageWidth, kImageHeight);
  self.mainView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
  self.mainView.image = [UIImage imageNamed:@"scene1.jpg"];
  [self.containerView addSubview:self.mainView];
  
  // Create the alternate image view (to transition between).
  CGRect imageFrame = CGRectMake(0.0, 0.0, kImageWidth, kImageHeight);
  self.flipToView = [[[UIImageView alloc] initWithFrame:imageFrame] autorelease];
  self.flipToView.image = [UIImage imageNamed:@"scene2.jpg"];
  CGAffineTransform rotate=CGAffineTransformMakeRotation(3.14/2);
  [containerView setTransform:rotate];
  [self.view addSubview:containerView];
  rotate=CGAffineTransformMakeRotation(-3.14/2);
  [mainView setTransform:rotate];
  [self.containerView addSubview:mainView];
  [self.mainView addSubview:flipToView];
  </code></pre>
  
  <p>// I have put it on button action event.</p>
  
  <pre><code>- (IBAction)flipAction:(id)sender{
      [UIView beginAnimations:nil context:NULL];
      [UIView setAnimationDuration:4];
      [UIView setAnimationTransition:([self.mainView superview] ?
                                          UIViewAnimationTransitionCurlDown : UIViewAnimationTransitionCurlDown)
                                          forView:self.containerView cache:YES];
      if ([flipToView superview])
      {
          [self.flipToView removeFromSuperview];
          [self.containerView addSubview:mainView];
      }
      else
      {
          [self.mainView removeFromSuperview];
          [self.containerView addSubview:flipToView];
      }
      [UIView commitAnimations];
  }
  </code></pre>