IPhone card as flip animation

I am trying to create an animation with a map translation on iOS, and I fail.
Basically I have a global view with a controller. Inside I have a View holder that contains a map.
I have a front map, which is the mainView, and then a back side of the map, which is flipSideView.

I tried to do something like this:

[UIView animateWithDuration:1.0 delay:0 options:UIModalTransitionStyleFlipHorizontal animations:^{ NSLog(@"started"); [mainView removeFromSuperview]; [holderView addSubview:flipsideView]; } completion:^(BOOL finished){ NSLog(@"completed"); }]; 

It doesn’t work, it does strange things, I tried many different things, but I can’t get it to work perfectly. Can anyone think how I can do this?

thanks

+6
source share
1 answer

Try the following:

 [UIView transitionFromView:mainView toView:holderView duration:1.0f options:UIViewAnimationOptionTransitionFlipFromRight completion:^(BOOL finished) {}]; 

That should work. Hope this helps!

+9
source

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


All Articles