Source Download
Side Pull Drawer effect Demo
you need to import a third-party class library as follows:
Drawer effect required third-party class library download
effect: The drawer effect can be achieved on both sides or only in the left column or the right side of the drawer.
about the drawer effect is mainly appdelegate code
AppDelegate.h file Code:
<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;" > #import <UIKit/UIKit.h> @interface yjfappdelegate:uiresponder <UIApplicationDelegate> @property ( Strong, nonatomic) UIWindow *window; @end </span></span>
appdelegate.m File Code
<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:24PX;" ><span style= "FONT-SIZE:18PX;" > #import "YJFAppDelegate.h" #import "CustomizedNavigationController.h" #import "FirstViewController.h" #import " SecondViewController.h "#import" ThirdViewController.h "@implementation yjfappdelegate-(BOOL) Application: ( UIApplication *) Application didfinishlaunchingwithoptions: (nsdictionary *) launchoptions{Self.window = [[UIWindow] Alloc] Initwithframe:[[uiscreen mainscreen] bounds]; Main view Firstviewcontroller *FIRSTVC = [[Firstviewcontroller alloc] init]; Left view Secondviewcontroller *SECONDVC = [[Secondviewcontroller alloc] init]; Right view Thirdviewcontroller *THIRDVC = [[Thirdviewcontroller alloc] init]; Customizednavigationcontroller *NAVIGATIONVC = [[Customizednavigationcontroller alloc] Initwithrootviewcontroller: FIRSTVC]; Customizednavigationcontroller *LEFTNAVIGATIONVC = [[Customizednavigationcontroller alloc] INITWITHROOTVIEWCONTROLLER:SECONDVC]; Customizednavigationcontroller *RIGHTNAVIGATIONVC = [[Customizednavigationcontroller alloc] INITWITHROOTVIEWCONTROLLER:THIRDVC]; Drawer Management Third party//The third party can only implement open the left sidebar can also be implemented to open the right column, but also can be implemented mmdrawercontroller *ROOVC = [[Mmdrawercontroller alloc] Initwithcent ERVIEWCONTROLLER:NAVIGATIONVC LEFTDRAWERVIEWCONTROLLER:LEFTNAVIGATIONVC Rightdrawerviewcontroller: RIGHTNAVIGATIONVC]; Only implement open left column//mmdrawercontroller *roovcleft = [[Mmdrawercontroller alloc] Initwithcenterviewcontroller:navigationvc LEFTDRAWERVIEWCONTROLLER:FIRSTVC]; Only implement open right column//mmdrawercontroller *roovcright = [[Mmdrawercontroller alloc] Initwithcenterviewcontroller:navigationvc RIGHTDRAWERVIEWCONTROLLER:THIRDVC]; Specifies the window's root view Self.window.rootViewController = ROOVC; The width of the door was measured [ROOVC setmaximumleftdrawerwidth:270]; Set the side door open and close animation [ROOVC Setopendrawergesturemodemask:mmopendrawergesturemodeall]; [ROOVC Setclosedrawergesturemodemask:mmclosedrawergesturemodeall]; Side open content Display//settings swipe left to open the right sidebar [[Mmexampledrawervisualstatemanager Sharedmanager] setrightdraweranimationtype:mmdraweranimationtypenone]; Set swipe right to open the left column [[Mmexampledrawervisualstatemanager Sharedmanager] Setleftdraweranimationtype: Mmdraweranimationtypenone]; [ROOVC setdrawervisualstateblock:^ (Mmdrawercontroller *drawercontroller, Mmdrawerside drawerSide, CGFloat Percentvisible) {Mmdrawercontrollerdrawervisualstateblock block; block = [[Mmexampledrawervisualstatemanager Sharedmanager] drawervisualstateblockfordrawerside:drawerside] ; if (block) {block (Drawercontroller, drawerside, percentvisible); } }]; Self.window.backgroundColor = [Uicolor Whitecolor]; [Self.window makekeyandvisible]; return YES;} </span></span></span>
iOS side pull Drawer effect Demo