Reputation: 683
I try to go back to the first view and animate it. However the animation does not work. The code is shown below:
- (IBAction)geriBtnClick:(id)sender {
[UIView beginAnimations:@"flipping view" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:self.view cache:YES];
[self.view removeFromSuperview]; //ikinci view kaldır.
[UIView commitAnimations];
}
Please advise on what is wrong with this and how it can be resolved.
Upvotes: 0
Views: 211
Reputation: 299275
The way to manage the back button is with UINavigationController
. You should be calling [navController popViewControllerAnimated:YES]
. That will create the segue you're looking for. Otherwise you're going to have to create the entire transition, just just remove the view. Creating your own transitions is not a beginner subject; you want to use UINavigationController
.
Upvotes: 1
Reputation: 13
every time you are removing the view
[self.view removeFromSuperview];
are you sure about that piece of code like it will remove the current view from the super view and in case if you wana see the view again you should re-add the view once again after the animation for the animation to work.
The code will work one time not again and again
Upvotes: 0