I'd like to be able to navigate to another viewController by pinching view on the current viewController.
The console shows that the view is recognising the pinch gesture and it logs it.
However I'm not clear on how I can trigger the pinch to open another ViewController.
Here is the code that I've used to implement this.
- (void)viewDidLoad
{
[super viewDidLoad];
//Pinch Gesture
UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
[self.view addGestureRecognizer:pinchGesture];
}
- (IBAction)handlePinchGesture:(UIPinchGestureRecognizer *)sender
{
NSLog(@" ((UIPinchGestureRecognizer *) sender).scale %f", ((UIPinchGestureRecognizer *) sender).scale);
if (((UIPinchGestureRecognizer *)sender).scale > 1.0)
{
//I tried to use a different method to instantiate AustraliaViewController but it //doesn't work
//[self.storyboard instantiateViewControllerWithIdentifier:@"Australia"];
AustraliaViewController *aust = [[AustraliaViewController alloc] initWithNibName:@"Australia" bundle:Nil];
aust.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:aust animated:YES completion:Nil];
}
[self showInfo:(id)sender];
}