iPad App Store, UIView. , , :
1) 90 ,
2) , , . , , .
, .
, , . . :
1) backView , frontView
2) frontView,
3) backView , frontView
4) backView
5) backView,
. .
- (void)flipFromFront:(UIView*)frontView toBack:(UIView*)backView
{
float duration = 0.5;
float dx = self.view.center.x - frontView.center.x;
float dy = self.view.center.y - frontView.center.y;
backView.layer.zPosition = 200.0;
backView.hidden = NO;
backView.alpha = 0.0;
backView.frame = frontView.frame;
[UIView animateKeyframesWithDuration:duration
delay:0.25
options:UIViewKeyframeAnimationOptionCalculationModeCubic
animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0
relativeDuration:0.5
animations:^{
CATransform3D xform = frontView.layer.transform;
xform = CATransform3DTranslate(xform, dx/2, dy/2, 0);
xform = CATransform3DRotate(xform, M_PI_2, 0, 1, 0);
xform = CATransform3DScale(xform, 1.5, 1.5, 1);
frontView.layer.transform = xform;
}];
[UIView addKeyframeWithRelativeStartTime:0.5
relativeDuration:0.0
animations:^{
backView.layer.transform = frontView.layer.transform;
backView.alpha = 1.0;
}];
[UIView addKeyframeWithRelativeStartTime:0.5
relativeDuration:0.5
animations:^{
backView.layer.transform = CATransform3DIdentity;
backView.frame = self.containerView.frame;
}];
} completion:^(BOOL finished) {
self.displayingFront = !self.displayingFront;
}];
}
- (void) flipFromBack:(UIView*)backView toFront:(UIView*)frontView
{
float duration = 0.5;
float dx = self.view.center.x - frontView.center.x;
float dy = self.view.center.y - frontView.center.y;
backView.layer.zPosition = 200.0;
frontView.hidden = YES;
[UIView animateKeyframesWithDuration:duration
delay:0
options:UIViewKeyframeAnimationOptionCalculationModeCubic
animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0
relativeDuration:0.5
animations:^{
CATransform3D xform = backView.layer.transform;
xform = CATransform3DTranslate(xform, -dx/2, -dy/2, 0);
xform = CATransform3DRotate(xform, M_PI_2, 0, 1, 0);
xform = CATransform3DScale(xform, 0.75, 0.75, 1);
backView.layer.transform = xform;
}];
[UIView addKeyframeWithRelativeStartTime:0.5
relativeDuration:0.0
animations:^{
backView.alpha = 0.0;
frontView.hidden = NO;
}];
[UIView addKeyframeWithRelativeStartTime:0.5
relativeDuration:0.5
animations:^{
self.hiddenView.alpha = 0.0;
frontView.layer.transform = CATransform3DIdentity;
}];
} completion:^(BOOL finished) {
self.displayingFront = !self.displayingFront;
}];
}