How to set MMDrawerController drawer width to screen width using Swift 2?

I am using MMDrawerController in my project. I have a Menu that shows from left to right, and it works correctly. But my requirement is to have a box that has the width of the current screen width. How can I do this with Swift?

Currently, the screen looks like this: I need the white area to cover the entire screen.

enter image description here

+5
source share
1 answer

Use the setMaximumLeftDrawerWidth property of the MMDrawerController as

  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; 
+6
source

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


All Articles