I have a pdf page displayed with CGContextDrawPDFPage in QuartzDemo sample application.
I want to keep this page shown and have an image slide in from top over this page, just as it can be seen in the iBooks application.
It's a book, the sliding image is a bookmark that slides in when you are about to close the book.
I added this code by DyingCactus (hint: im a newbie to obj c and iphone dev) as follows:
In QuartzViewController.m, the animation starts to show but the view slides away before the animation is finished, in fact I think the animation goes on while the view is sliding away.
-(void)viewWillDisappear:(BOOL)animated
{
[self.quartzView setFrame:CGRectMake(150, -200, 100, 200)];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[self.quartzView setFrame:CGRectMake(150, 0, 100, 200)];
[UIView commitAnimations];
}
How can I keep the view visible and finish the animation before view disappears?