Latest 1.0.0
Homepage https://github.com/muyexi/SemiModalViewController
License MIT
Platforms ios 8.0
Authors

CocoaPods
license

UIViewController extension to present view / view controller as bottom-half modal.

SemiModalViewController

Installation

CocoaPods

pod 'SemiModalViewController'

Usage

Present a view controller:

let options = [
    SemiModalOption.pushParentBack: true
]

let controller = UIViewController()

controller.view.height = 200
controller.view.backgroundColor = UIColor.redColor()

presentSemiViewController(controller, options: options, completion: {
    print("Completed!")
}, dismissBlock: {
    print("Dismissed!")
})

Or view:

let view = UIView(frame: UIScreen.mainScreen().bounds)
view.height = 300
view.backgroundColor = UIColor.redColor()

presentSemiView(view, options: options) {
    print("Completed!")
}

Dismiss a presented view / view controller:

dismissSemiModalView()

Default options:

SemiModalOption.traverseParentHierarchy : true,
SemiModalOption.pushParentBack          : false,
SemiModalOption.animationDuration       : 0.5,
SemiModalOption.parentAlpha             : 0.5,
SemiModalOption.parentScale             : 0.8,
SemiModalOption.shadowOpacity           : 0.5,
SemiModalOption.transitionStyle         : .slideUp,
SemiModalOption.disableCancel           : true

Credits

SemiModalViewController is based on KNSemiModalViewController.

License

SemiModalViewController is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "SemiModalViewController",
    "version": "1.0.0",
    "platforms": {
        "ios": "8.0"
    },
    "summary": "Present view / view controller as bottom-half modal",
    "license": "MIT",
    "homepage": "https://github.com/muyexi/SemiModalViewController",
    "authors": {
        "muyexi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/muyexi/SemiModalViewController.git",
        "tag": "1.0.0"
    },
    "source_files": "Source/*.swift",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This