Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display fullscreen view controller from UIInputViewController

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

like image 881
virindh Avatar asked Jun 18 '15 16:06

virindh


People also ask

How do you make swift full screen?

Press Ctrl + Drag your UIView to Safe Area, choose Equal Height and do the same for the Width. Save this answer.

How do I make my view controller full screen?

Present ViewController in full screen To prevent this, the presentation style can be changed. To present the DetailViewController full screen, the modalPresentationStyle property of a view controller must be set to . fullScreen before it will be presented.


1 Answers

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:^{

        }];
}
like image 172
sheraza Avatar answered Oct 02 '22 08:10

sheraza