I want to include Flip view in my project. I made it like this but cant work properly
and secondary view contains an image veiw
UIBarButtonItem *flipButton = [[UIBarButtonItem alloc]
initWithTitle:@"Flip"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(flipView)];
self.navigationItem.leftBarButtonItem = flipButton;
UIBarButtonItem *returnButton = [[UIBarButtonItem alloc]
initWithTitle:@"return"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(returnView)];
self.navigationItem.leftBarButtonItem = returnButton;
and i set the action like this
- (void)flipView{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationOptionTransitionFlipFromTop
forView:[self view]
cache:YES];
[self.view addSubview:secondaryView];
[UIView commitAnimations];
}
- (void)returnView {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:[self view]
cache:YES];
[secondaryView removeFromSuperview];
[UIView commitAnimations];
}
surely as you’re putting the code, nothing happens because you’re not giving the opportunity to do the flip.
try to MOVE these lines:
inside of flipView, after or before the animation. And copy these other lines:
inside of returnView. You’ll see the change.
I hope to be helpful!