presentViewController shows black page presentViewController shows black page xcode xcode

presentViewController shows black page


You are not entering the nib name for the user Interface:

SuccessOrFailViewController *sfvc = [[SuccessOrFailViewController alloc] initWithNibName:@"SuccessOrFailViewController" bundle:nil];[self presentViewController:sfvc animated:NO completion:NULL];

For storyboard this is the way to go:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];SuccessOrFailViewController *sfvc = [storyboard instantiateViewControllerWithIdentifier:@"SuccessOrFailViewController"];[sfvc setModalPresentationStyle:UIModalPresentationFullScreen];[self presentModalViewController:sfvc animated:YES];


Swift

var next = self.storyboard?.instantiateViewControllerWithIdentifier("DashboardController") as! DashboardControllerself.presentViewController(next, animated: true, completion: nil)

don't forget to set ViewController StoryBoard Id in StoryBoard -> identity inspector


Incase anyone else finds this, make sure you haven't set self.view.backgroundColor = UIColor.clearColor() in the view to be shown... This solved it for me.