A tiny library (one UIViewController) that makes presenting modal screens much easier. It mimics the presentation animation and feel of UIActionSheet but leaves all design to the developer. A custom controller is animated up from the bottom of the screen and the view "underneath" is grayed out. Tapping anywhere on the presenting view will dismiss the presented controller.
To run the example project, clone the repo, and run pod install from the Example directory first.
CustomHeightPresentationController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CustomHeightPresentationController'Create a UIViewController that conforms to CustomHeightPresentable and add the following to init():
modalPresentationStyle = .custom
transitioningDelegate = selfThen in that controller's extension of UIViewControllerTransitioningDelegate add the following:
func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
return CustomHeightPresentationController(presentedViewController: presented, presenting: presenting)
}A full implementation exists in the example project.
Joe Masilotti, joe@masilotti.com
CustomHeightPresentationController is available under the MIT license. See the LICENSE file for more info.
