presentModalViewController in iOS6

27,461

Solution 1

Deprecated means that you shouldn't use this method anymore. It still works, but it might be completely removed in one of the next updates.

For displaying view controllers modally, you can use the new -presentViewController:animated:completion: method introduced in iOS 5.0.
For dismissing the new method is -dismissViewControllerAnimated:completion:.

https://developer.apple.com/documentation/uikit/uiviewcontroller

Solution 2

If you have

[self presentModalViewController:aController animated:YES];

change it to

[self presentViewController:aController animated:YES completion:nil];
Share:
27,461

Related videos on Youtube

user975561
Author by

user975561

Updated on July 10, 2022

Comments

  • user975561
    user975561 almost 2 years

    In my app's code I am still presenting viewcontrollers modally with presentModalViewController. This is deprecated in iOS 6. Does that mean this method has no effect on devices running iOS 6?

    If yes, how can I make my app present viewcontrollers modally on iOS 6? My Xcode version does not support iOS 6, so all new methods in iOS 6 are unavailable to me.

  • Philippe Chaintreuil
    Philippe Chaintreuil over 9 years
    I think the dismiss is -dismissViewControllerAnimated:completion:.
  • Ravi Mehta
    Ravi Mehta almost 9 years
    i have tried to change self.viewController presentModalViewController:nav animated:YES to -dismissViewControllerAnimated:completion: not working guide me please
  • Fabian Kreiser
    Fabian Kreiser almost 9 years
    -presentModalViewController:animated should be replaced by -presentViewController:animated:completion: