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
  • 920
  • 7
  • 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
  • 1,849
  • 1
  • 11
  • 19