+
Skip to content

apparition47/Sheetable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sheetable

Present any UIViewController as a bottom sheet modal with interactive dismissal.

Originally based on HalfModalPresentationController.

Demo

How to use

  1. Conform the UIViewController you want to present as a bottom sheet modal to Sheetable. [Optional] Override height to how much of the screen you want your view to take up from the bottom.
class DetailViewController: UIViewController {}

extension DetailViewController: Sheetable { // <--
    var height: CGFloat { return 400 } // optional
}
  1. Before presenting your UIViewController from the nav stack, call setTransitioningDelegate().
class HomeViewController: UIViewController {
    @IBAction func showModalButtonPressed(_ sender: Any) {
        let vc = DetailViewController()
        vc.setTransitioningDelegate() // <--
        navigationController.present(vc, animated: true)
    }
}

License

MIT

About

Transition any UIViewController as a bottom sheet

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载