IOS drawer effect, ios drawer
Source code download
Download third-party library for drawer Effect
Download third-party class libraries
Side pane drawer
Header file to be imported:
#import "MMDrawerController.h"#import "MMExampleDrawerVisualStateManager.h"
Code implementation:
First, create three controllers
// The main view FirstViewController * firstVC = [[FirstViewController alloc] init]; // The Left view SecondViewController * secondVC = [[SecondViewController alloc] init]; // ThirdViewController * thirdVC = [[ThirdViewController alloc] init]; CustomizedNavigationController * navigationVC = [[CustomizedNavigationController alloc] initWithRootViewController: firstVC]; customizedNavigationController * direction = [[CustomizedNavigationController alloc] direction: secondVC]; CustomizedNavigationController * rightNavigationVC = [[CustomizedNavigationController alloc] initWithRootViewController: thirdVC]; // drawer management third party // This third party can open either the left sidebar or the right sidebar, or both MMDrawerController * rooVC = [[MMDrawerController alloc] initWithCenterViewController: navigationVC navigation: logging rightDrawerViewController: rightNavigationVC]; // only enables opening the left sidebar // MMDrawerController * rooVCLeft = [[MMDrawerController alloc] handler: navigationVC leftDrawerViewController: firstVC]; // open the right column only. // MMDrawerController * rooVCRight = [[MMDrawerController alloc] initWithCenterViewController: navigationVC rightDrawerViewController: thirdVC]; // specify the window Root View self. window. rootViewController = rooVC; // tested the door width [rooVC setMaximumLeftDrawerWidth: 270]; // set the animation for side trim Opening and Closing [rooVC setOpenDrawerGestureModeMask: unlock]; [rooVC trim: MMCloseDrawerGestureModeAll]; // The displayed content is displayed. // sliding left to open the right column [[MMExampleDrawerVisualStateManager sharedManager] setRightDrawerAnimationType: MMDrawerAnimationTypeNone]; // set to slide to the right to open the left sidebar [[sharesharedmanager] role: role]; [rooVC setDrawerVisualStateBlock: ^ (MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible) {distributed block; block = [[MMExampleDrawerVisualStateManager sharedManager] drawerVisualStateBlockForDrawerSide: drawerSide]; if (block) {block (drawerController, drawerSide, percentVisible) ;}}];
How to Implement drawer interaction menus like Netease iOS clients in ios
Similar to Netease's interactive network, there is a dedicated Demo, PPRevealSideViewController
How does the ios drawer effect determine the external area of the drawer? How to remove help
You can put your drawer in a view to know the Coordinate Position of the current view in your Vc. You can judge that the current view is not available in this area to view the original post>