I am working on an iPad application that has a small pop-up view in front of the main background.
A single photo and related notes, etc. are displayed in a pop-up window. The main view is a bunch of thumbnails
I want to implement actions like left / right scroll to replace the popup view with a new popup view with animation.
MyPopupViewController *newPopView = [[MyPopupViewController alloc] initWithData:...];
[UIView animateWithDuration:0.4
delay:0
options:UIViewAnimationOptionCurveEaseInOut
animations: ^{
[self.view addSubView: newPopView.view];
[popView removeFromSuperView];
[UIView setAnimationTransition: UIViewAnimationTransitionCurlUp
forView:popView cache:YES];
} completion:^(BOOL finished) { popView = newPopView }
];
[newPopView release];
Well, that doesn't work. I cannot delete the old view in the animation block, otherwise the animation will not work. I cannot delete it in the completion block, because during the animation the old image will still be displayed underneath.
I spent quite a lot of time playing with sequences, but just can't get it to work. Please, help.
Thanks in advance. Leo