5

I want a bottom sheet to show on a scene with Google map on viewDidLoad() but the only bottom sheet example I found on the material.io website gets triggered with a button.

How do I use MDCBottomSheetController to achieve this?

bcr
  • 950
  • 8
  • 28
Stone Cold
  • 166
  • 1
  • 2
  • 8

1 Answers1

4

@stone-cold See below-mentioned code.

import MaterialComponents.MaterialButtons

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let bottomSheet = MDCBottomSheetController(contentViewController: viewController)

        // Present the bottom sheet
        present(bottomSheet, animated: true, completion: nil)
    }

}

See more details here https://github.com/material-components/material-components-ios/tree/develop/components/BottomSheet

Satish
  • 2,015
  • 1
  • 14
  • 22