Latest 0.1.0
Homepage https://github.com/joemasilotti/CustomHeightPresentationController
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

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.

Example

Screenshot

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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 = self

Then 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.

Author

Joe Masilotti, [email protected]

License

CustomHeightPresentationController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CustomHeightPresentationController",
    "version": "0.1.0",
    "summary": "A presentation wrapper to show a controller that doesn't fill the full screen.",
    "description": "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.",
    "homepage": "https://github.com/joemasilotti/CustomHeightPresentationController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Joe Masilotti": "[email protected]"
    },
    "source": {
        "git": "https://github.com/joemasilotti/CustomHeightPresentationController.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/joemasilotti",
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.0",
    "source_files": "CustomHeightPresentationController/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This