modalviewcontroller
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
Dismiss modal view form sheet controller on outside tap
I know this is an old question but this IS possible, despite of what the “right” answer says. Since this was the first result when I was looking for this I decided to elaborate: This is how you do it: You need to add a property to the View Controller from where you want to … 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
iPad custom size of modal view controller
As some other users here, I also had the problem that the origin of the modal view controller was not correct. After some experiments, I found a solution that worked for me: – (void)viewWillLayoutSubviews{ [super viewWillLayoutSubviews]; self.view.superview.bounds = CGRectMake(0, 0, <width>, <height>); }
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