there are lots of answers but none seems to be working normally/perfectly for iOS 9 specifically 9.2.. Someone help with it please. Its a simple scenario where:
1) Storyboard segues are connected to a single toBePresentedModally View Controller, i chose UIModalPresentationOverCurrentContext as well as switched and tried with UIModalPresentationCurrentContext when style from storyboard wasn't working.
2) i either get a black background after 1 second of happiness (it works fine for just a second) OR i get a blank controller when trying to present it through code by allocating a class of toBePresentedModally View Controller.
DashboardSettingsViewController *view=[self.storyboard instantiateViewControllerWithIdentifier:@"dashboardSettings"];
view.providesPresentationContextTransitionStyle = YES;
view.definesPresentationContext = YES;
CATransition *transition = [CATransition animation];
transition.duration = 0.5;
transition.type = kCATransitionFade;
//// for a smoother navigation
UIView *containerView = self.view.window;
[containerView.layer addAnimation:transition forKey:nil];
[self.navigationController presentViewController:view animated:YES completion:nil];
// lastly the background of to be presented view controller should be set to clear with alpha of your choice!
Asked in February 2016Viewed 1,225 timesVoted 14Answered 4 times