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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With