1

According to the material.io documentation, the Modal Navigation Drawer should be used for sideMenus on mobile device but their api almost only contain drawers for the bottom, MDCBottomDrawerViewController, MDCBottomDrawerPresentationController etc. What about the side drawer? I checked but didn't find a MDCSideDrawerViewController.

The following code uses the MDCBottomDrawerViewController, but the problem is that the MDCBottomDrawerViewController().contentViewController presents my table from the botton instead of the from the side.

Set up for bottomDrawVC:

var bottomDrawerViewController: MDCBottomDrawerViewController = {
    let drawer = MDCBottomDrawerViewController()        
    drawer.isTopHandleHidden = false
    drawer.dismissOnBackgroundTap = true
    return drawer
}()

The presenting of the bottomDrawVC:

@IBAction func toggleSideMenu() {
 let storyBoard = UIStoryboard.init(name: "Main", bundle: nil)
 let vc = storyBoard.instantiateViewController(withIdentifier: "TableViewController")
 let size = CGSize(width: view.frame.width, height: view.frame.height)
 bottomDrawerViewController.contentViewController?.preferredContentSize = size 
 bottomDrawerViewController.contentViewController = vc
 present(bottomDrawerViewController, animated: true, completion: nil)
}

As I can't seem to find info in the docs, how does one present a modal side menu with material.io on iOS?

KarmaDeli
  • 610
  • 1
  • 6
  • 16
  • I have run into this same problem as well. Material's documentation on it is incredibly unhelpful. Have you found a solution yet, @KarmaDeli? – Lane Faison Jul 21 '20 at 18:57
  • Last I checked, modal side menu is in beta and unavailable. Instead, I used ContainerViewControllers. – KarmaDeli Jul 23 '20 at 15:43

0 Answers0