Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross dissolve transition required without using segue

Tags:

xcode

ios6

ipad

I want to use the Cross Dissolve transition but not by using a segue. I use the code below to present the new view when a button is pressed but the transition is Cover Vertical. Is there any way of changing this?

ObViewControllerMonitorMenu *monitorMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"observationSummary"];
monitorMenuViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:monitorMenuViewController animated:YES completion:nil];

The code above now works with the additional line to set the transition type.

like image 281
RGriffiths Avatar asked May 22 '13 23:05

RGriffiths


1 Answers

Please take a look at the documentation to see the list of transition style while presenting a view controller modally, especially at the section Presenting View Controllers:

https://developer.apple.com/reference/uikit/uiviewcontroller?language=objc

(Swift Answer)

And then you can set the modalTransitionStyle property of the view controller to the desired value, in which what you want is UIModalTransitionStyleCrossDissolve.

like image 125
Valent Richie Avatar answered Sep 21 '22 12:09

Valent Richie