patoroco / Modaly

Configure size of modal panels from storyboard with a custom segue
MIT License
17 stars 0 forks source link

Presented view loses frame after another view controller is presented on top #3

Open maroni2 opened 9 years ago

maroni2 commented 9 years ago

After presenting a view controller with JMGModaly, and then presenting another view controller on top of that one (this time, with no transitioningDelegate--just a simple [self presentViewController:controller animated:YES completion:nil];, the first view controller that was presented to a custom frame is now fitted to the screen bounds.

Simple repro: Add the following to SecondViewController.m

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        UIViewController *controller = [[UIViewController alloc] init];
        controller.view.backgroundColor = [UIColor whiteColor];
        [self presentViewController:controller animated:YES completion:nil];
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [controller dismissViewControllerAnimated:YES completion:nil];
        });
    });
}

See attached screenshots for the before/after effect on the "square presented" view controller:

Before After

patoroco commented 9 years ago

Have you try to set fullScreen property to yes and show the next modal panel (with origin on JMGModaly) using this instead of "common" modal panel?

I'm not sure how to fix that, if you have any suggestion, I would appreciate to include it in the lib.