iOS drawer effect

Source: Internet
Author: User

SOURCE download

Drawer effect third-party class library download

Required third-party class library download

Drawer side pull-out bar


header files that need to be imported:

#import "MMDrawerController.h" #import "MMExampleDrawerVisualStateManager.h"
Code implementation:

First you need to create three attempt controllers

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 column [[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); }    }];




iOS drawer effect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.