Search code examples
iosuiviewcontrollerios7seguechildviewcontroller

iOS7 present childViewController similar to MFMailComposeViewController for iPad


One of the view controllers in my iPad app is a questionnaire form. I'm trying to present it so that it appears in a childViewController modal segue just like the default segue for MFMailComposeViewController.

This is the look I am trying to achieve:

enter image description here

The code I am using doesn't seem to be working:

AskQuestionViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"AskQuestionViewController"];
[self addChildViewController:vc];
vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.splitViewController presentViewController:vc animated:YES completion:nil];

Solution

  • Try:

    AskQuestionViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"AskQuestionViewController"];
    vc.modalPresentationStyle = UIModalPresentationPageSheet;
    [self.splitViewController presentViewController:vc animated:YES completion:nil];