How to dismiss a view controller opened with presentModalViewController:

WangYang picture WangYang · Mar 1, 2011 · Viewed 27.4k times · Source

I presented a view controller using presentModalViewController:, now how to close/dismiss it?

Answer

Nithinbemitk picture Nithinbemitk · Jan 12, 2013

For iOS6 use this code

[self dismissViewControllerAnimated:YES completion:Nil];

instead of

[self dismissModalViewControllerAnimated:YES];

This may help you.