How to present a semi-transparent (half-cut) viewcontroller in iOS 8

SuperHappy picture SuperHappy · Jun 11, 2014 · Viewed 8.6k times · Source

in iOS 7 there is no problem for this method:

_rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[_rootViewController presentViewController:self animated:NO completion:nil];

But in iOS 8 it did nothing.How to solve it? Is it a Bug for iOS 8?

Answer

ushisantoasobu picture ushisantoasobu · Sep 11, 2014

My answer is more simple, below code. This works in iOS8 (XCode6 GM seed).

HogeViewController *vc = [[HogeViewController alloc] init];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self presentViewController:vc animated:NO completion:nil];