5

I am Using MMDrawerController on my Project. I have a Menu that shows from Left to Right and It is working Properly. But my requirement is to have a drawer that have a width of the current screen Width. How can i do that Using Swift ?

Currently the screen looks like this , I need to have the White area to cover Up the Entire Screen.

enter image description here

Joker
  • 830
  • 2
  • 14
  • 30

1 Answers1

7

Use setMaximumLeftDrawerWidth property of MMDrawerController like

  centerContainer?.setMaximumLeftDrawerWidth(UIScreen.mainScreen().bounds.width, animated: true, completion: nil)  

You can check the method in MMDrawerController.h

-(void)setMaximumLeftDrawerWidth:(CGFloat)width animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
Bhavin Bhadani
  • 22,224
  • 10
  • 78
  • 108
  • I saw Some Codes to do the same , Should i have to include that in AppDelegate file ? – Joker Oct 13 '15 at 05:24
  • yes...whenever I used,I used it in appDelegate file – Bhavin Bhadani Oct 13 '15 at 05:25
  • Please I'm setting the right menu depending on the button clicked (if the clicked button is btn1 so I set the right side menu to btnVC1, else I set it to btnVC2). The btnVC1 width have to be as the default given width by the MMDrawerController (less than the screen width), but the btnVC2 width has to be the same as the screen one. I set the width of each of them in the IBActions but when I swipe in order to close the right menu, the center view disapear (I get only black screen). Also the widths are not set correctly. Can you help me please? – Ne AS Jun 28 '17 at 18:31