How to use Flip Transition to go from UIView to TableViewController using NavigationController?

I have two views: one has only a button (view 1), and the other contains a table view with a search bar (screen2). When the user clicks this button in view 1, I want view 1 to display and display screen 2.

View 2 is located inside the navigation controller with the top navigation bar.

The following is what I have now. Transitional animation works and flips to the second screen, but in view 2 there is no SearchBar and title from the NavigationBar. Both are set inside view 2.


[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];

navigationController = [[UINavigationController alloc] init];

bestbuyProducts = [[BestBuyProductsViewController alloc] initWithNibName:@"BestBuyProductsViewController" bundle:nil];  
[navigationController pushViewController:bestbuyProducts animated:NO];
[navigationController.view setFrame: [self.view bounds]];
[bestbuyProducts release];

[self.view addSubview:navigationController.view];

[UIView commitAnimations];

thank

+3
2

UINavigationController . initWithRootViewController:

bestbuyProducts = [[BestBuyProductsViewController alloc] initWithNibName:@"BestBuyProductsViewController" bundle:nil];  

// Initialise the navigation view with the bestbuyProducts view controller
navigationController = [[UINavigationController alloc] initWithRootViewController:bestbuyProducts ];

-. :

[navigationController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:navigationController animated:YES];

[navigationController release];
[bestbuyProducts release];
+4

,


navigationController = [[UINavigationController alloc] initWithRootViewController:bestbuyProducts];
[bestbuyProducts setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:navigationController animated:YES];
+1

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


All Articles