The only way in which to easily create it is through the use of UIView's class methods as follows:
This code goes within the MyViewController.h file:
@interface MyViewController : UIViewController
{
UIImageView* imageView1;
UIImageView* imageView2;
}
@end
This code goes within the MyViewController.m file:
@implementation MyViewController
- (void) dealloc
{
[imageView2 release];
[imageView1 release];
[super dealloc];
}
- (void) loadView
{
self.view = [[UIView alloc] initWithFrame : CGRectMake (0, 0, 768, 1004)];
UIImage* image1 = [[UIImage alloc] initWithContentsOfFile : @"image1.png"];
UIImage* image2 = [[UIImage alloc] initWithContentsOfFile : @"image2.png"];
imageView1 = [[UIImageView alloc] initWithImage : image1];
imageView2 = [[UIImageView alloc] initWithImage : image2];
[imageView1 setFrame : CGRectMake (0, 0, 768, 1004)];
[imageView1 setFrame : CGRectMake (0, 0, 768, 1004)];
[self.view addSubview : imageView1];
[image2 release];
[image1 release];
}
- (void) viewDidUnload
{
imageView2 = nil;
imageView1 = nil;
[super viewDidUnload];
}
- (void) touchesBegan : (NSSet*) touches withEvent : (UIEvent*) event
{
[UIView beginAnimations : nil context : nil];
[UIView setAnimationCurve : UIViewAnimationCurveLinear];
[UIView setAnimationDuration : 0.25];
if (imageView1.superview != nil)
{
[UIView setAnimationTransition : UIViewAnimationTransitionCurlUp forView : self.view cache : YES];
[imageView1 removeFromSuperview];
[self.view addSubview : imageView2];
}
else
{
[UIView setAnimationTransition : UIViewAnimationTransitionCurlDown forView : self.view cache : YES];
[imageView2 removeFromSuperview];
[self.view addSubview : imageView1];
}
[UIView commitAnimations];
}
@end
Since, in this example, the UIViewController is being created programmatically, the method "loadView" was used in order to create the view managed by the view controller and the subviews which this view will manage. I hope this helps. Cheers.