I am using this code for Page curl effect ....Its work fine in simulator and device... But its not (setType:@\"pageCurl\") apple documented api , this caused it to be reject
Must the stop-at-mide-point page curl effect be used? The easiest method is to replace page curl by a simpler animation (e.g. slide-out), or just curl the whole view up.
You may try to cheat by constructing the string at run time e.g.
[animation setType:[@"page" stringByAppendingString:@"Curl"]];
although you're still using an undocumented method.
I found a solution to add an UIView to UIViewController using Animation block.
m_Container is an UIView who contain my view animation (self). self is an UIView.
CAUTION : You need to have import QuartzCore
To present view with page curl animation you can use :
-(void)PresentView
{
[UIView animateWithDuration:1.0
animations:^{
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.7];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.65;
[animation setRemovedOnCompletion:NO];
[m_container.layer addAnimation:animation forKey:@"pageCurlAnimation"];
[m_container addSubview:self];
;}
];
}
And when you want hide this view you can use :
-(void)HideHelpView
{
[UIView animateWithDuration:1.0
animations:^{
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.7];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageUnCurl";
animation.fillMode = kCAFillModeForwards;
animation.startProgress = 0.35;
[animation setRemovedOnCompletion:NO];
[m_container.layer addAnimation:animation forKey:@"pageUnCurlAnimation"];
[self removeFromSuperview];
;}
];
}
Partial curling is officially supported since SDK 3.2. Check the sample code of Chris. More information can be found in the UIViewController Class Reference under Constants.
If I may?
SampleViewController *sampleView = [[[SampleViewController alloc] init] autorelease];
[sampleView setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentModalViewController:sampleView animated:YES];
......