Custom Segue with UIViewAnimationOptionTransitionCurlDown

I would like to create a custom segue for sharing ViewControllers with a curl of animation, but I cannot find a way, What would it be - (void) to do for this?

I have this one

-(void)perform{ UIViewController *dst = [self destinationViewController]; UIViewController *src = [self sourceViewController]; [UIView beginAnimations:nil context:nil]; //change to set the time [UIView setAnimationDuration:1]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:src.view cache:YES]; [UIView commitAnimations]; } 

But I canโ€™t change the idea, in any case, thanks for your help!

+4
source share
1 answer

Nevermind, I decided that for the record, the only thing I needed to do was add a navigation controller, and then I could use custom segues, for example:

 - (void) perform { UIViewController *src = (UIViewController *) self.sourceViewController; UIViewController *dst = (UIViewController *) self.destinationViewController; [UIView transitionWithView:src.navigationController.view duration:0.3 options:UIViewAnimationOptionTransitionFlipFromBottom animations:^{ [src.navigationController pushViewController:dst animated:NO]; } completion:NULL]; } 
+3
source

Source: https://habr.com/ru/post/1397275/


All Articles