Display fullscreen view controller from UIInputViewController

1.1k views Asked by At

I'm currently building a custom keyboard for iOS 8 though extensions. When the user presses a certain button on the keyboard view, I want to present a full screen modal view controller. When I try to present the view controller, it tries to present within the bounds of the keyboard view. I'm using [self presentViewController:animated:completion:] with an instantiated view controller. Is there anyway to present a full screen view controller? akin to photo editing extensions(which display a full screen view controller)

Thank you

2

There are 2 answers

4
Quentin Hayot On

You have to present your viewController from the controller that called the keyboard, not from the keyboard itself.

Try:

[self.parentViewController presentViewController:animated:completion:]
0
sheraza On

You should Increase height of your keyboard and then present your View Controller. Try something like this:

- (void) presentVC{
         NSLayoutConstraint *_heightConstraint = [NSLayoutConstraint constraintWithItem:self.view
                                                         attribute:NSLayoutAttributeHeight
                                                         relatedBy:NSLayoutRelationEqual
                                                            toItem:nil
                                                         attribute:NSLayoutAttributeNotAnAttribute
                                                        multiplier:1.0
                                                          constant:[UIScreen mainScreen].bounds.size.height];

        [self.view addConstraint: _heightConstraint];

        TestViewController *test = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
        [self presentViewController:test animated:YES completion:^{

        }];
}