UIModalPresentationOverFullScreen allows you to interact with the presentation controller below

I have a homepage view controller. In addition, I introduced the view controller, which acts as a box, and moved the view of this controller mainly off-screen. The modular drawer view controller has a navigation bar. You can see most of the homepage view under the drawer. When you click this drawer, full-screen mode opens, including the navigation bar.

In ios7, I installed the modalPresentationStyle representing controller to represent the UIModalPresentationCurrentContext . In ios8, I set the presented modalPresentationStyle presentation modalPresentationStyle to be UIModalPresentationOverFullScreen . Here is how it should be done.

  if ([PCDeviceManager isDeviceiOS7]) { AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext; } else { projectsVC.modalPresentationStyle = UIModalPresentationOverFullScreen; } [self presentViewController:projectsVC animated:NO completion:^{ CGRect frame = projectsVC.view.frame; frame.origin.y = self.view.frame.size.height - 45; [projectsVC.view setFrame:frame]; }]; 

In both ios7 and 8, a sliding transition is exactly what I want, the navigation bar reaches the top of the screen under the status bar.

However, in ios7, I can interact with subviews in the view of the homepage view controller. In ios8 I can’t ... I need to be able to interact with the table view on the main page. The box does not close the table, but they are in different controllers.

It works in ios7 - I can interact with the table on the main screen. How can I make this work on ios8?

EDIT: drawer images open and closed:

https://www.dropbox.com/s/5p3bqpygyoe1fdi/drawer.png?dl=0 https://www.dropbox.com/s/sml60bi0iqxmwzj/drawer%20open.png?dl=0

+5
source share

Source: https://habr.com/ru/post/1215266/


All Articles