Modal view controller won’t dismiss itself

Dude, I ran into the same problem.. and here is what I found about using parentViewController: Note that as of 5.0 this no longer will return the presenting view controller. This was written in the header file of UIViewController… I am using ShareKit, and the modalViewController was working perfectly in iOS4, but in iOS5, it … Read more

iOS Present modal view controller on startup without flash

All presentViewController methods require the presenting view controller to have appeared first. In order to hide the root VC an overlay must be presented. The Launch Screen can continued to be presented on the window until the presentation has completed and then fadeout the overlay. UIView* overlayView = [[[UINib nibWithNibName:@”LaunchScreen” bundle:nil] instantiateWithOwner:nil options:nil] firstObject]; overlayView.frame … Read more

How do I make an expand/contract transition between views on iOS?

Making the effect is simple. You take the full-sized view, initialize its transform and center to position it on top of the thumbnail, add it to the appropriate superview, and then in an animation block reset the transform and center to position it in the final position. To dismiss the view, just do the opposite: … Read more

Delay in presenting a modal view controller

It seems calling presentViewController:animated:completion from within tableView:didSelectRowAtIndexPath: is problematic. It’s difficult to find anything that stands out when using the Time Profiler in Instruments, also. Sometimes my modal view comes up in less than a second and other times it takes 4s or even 9s. I think it’s related to the underlying UIPresentationController and layout, … Read more

How can I detect the dismissal of a modal view controller in the parent view controller? [duplicate]

This answer was rewritten/expanded to explain the 3 most important approaches (@galambalazs) Blocks The simplest approach is using a callback block. This is good if you only have one listener (the parent view controller) interested in the dismissal. You may even pass some data with the event. In MainViewController.m SecondViewController* svc = [[SecondViewController alloc] init]; … Read more