Pushviewcontroller with zoom animation like ios photo app

I have two UIViewControllers. My first UIViewController shows various thumbnails, photos, and notes. And the second controller is available to display the selected video, photo or note in the previous controller. I also have a UICollectionView in my first controller, which lists everything as an Apple Photo App in iOS.

I use "pushviewcontroller" to show my second view controller.

UIStoryboard *sb=[UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
    FirstDetailViewController *fD=[sb instantiateViewControllerWithIdentifier:@"firstDetail"];
[self.navigationController pushViewController: seconVCObj animated: YES];

But I want to open it with a zoom effect like an ios photo app. When you touch a photo, the application shows the photo as a zoom.

+4
source share
1 answer

, .

pushviewcontroller presentModalViewController

Push Pop

:

UIViewController *yourViewController = [[UIViewController alloc]init];
[UIView  beginAnimations: @"Showinfo"context: nil];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController: yourViewController animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
0

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


All Articles