Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muyexi/SemiModalViewController
UIViewController extension to present view / view controller as bottom-half modal.
https://github.com/muyexi/SemiModalViewController
ios swift
Last synced: 6 days ago
JSON representation
UIViewController extension to present view / view controller as bottom-half modal.
- Host: GitHub
- URL: https://github.com/muyexi/SemiModalViewController
- Owner: muyexi
- License: mit
- Created: 2016-09-11T05:05:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-30T16:18:24.000Z (over 4 years ago)
- Last Synced: 2024-04-24T14:48:12.669Z (8 months ago)
- Topics: ios, swift
- Language: Swift
- Homepage:
- Size: 616 KB
- Stars: 80
- Watchers: 5
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - SemiModalViewController - Present view / view controller as bottom-half modal. (UI / Transition)
- awesome-ios-star - SemiModalViewController - Present view / view controller as bottom-half modal. (UI / Transition)
README
[![CocoaPods](https://img.shields.io/cocoapods/v/SemiModalViewController.svg?maxAge=2592000)](https://cocoapods.org/pods/SemiModalViewController)
[![SPM](https://img.shields.io/badge/SPM-supported-DE5C43.svg?style=flat)](https://swift.org/package-manager/)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/muyexi/SemiModalViewController/blob/master/LICENSE)`UIViewController` extension to present view / view controller as bottom-half modal.
## Installation
### CocoaPods
```ruby
pod 'SemiModalViewController'
```### Swift Package Manager
```swift
dependencies: [
.Package(url: "https://github.com/muyexi/SemiModalViewController.git", majorVersion: 0)
]
```## Usage
Present a view controller:
```swift
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:
```swift
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:
```swift
dismissSemiModalView()
```Default options:
```swift
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](https://github.com/kentnguyen/KNSemiModalViewController).
## License
SemiModalViewController is released under the MIT license. See LICENSE for details.