View with animation UIViewAnimationTransitionCurlUp

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.

// popView is the existing pop up view to be replaced
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

+3
2

, , , . .

+1

:

[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionTransitionCurlUp animations:^()
     {
         [UIView setAnimationTransition: UIViewAnimationTransitionCurlUp
                                forView:self.welcomScreen cache:YES];
         [self.welcomScreen setHidden:YES];
     }completion:^(BOOL finished)
     {
         [self.welcomScreen removeFromSuperview];
     }];
0

All Articles