https://github.com/tungvoduc/dtoverlaycontroller
A customizable and easy-to-use overlay view controller container.
https://github.com/tungvoduc/dtoverlaycontroller
overlay swift swift-package-manager swift5 uikit viewcontroller
Last synced: 10 months ago
JSON representation
A customizable and easy-to-use overlay view controller container.
- Host: GitHub
- URL: https://github.com/tungvoduc/dtoverlaycontroller
- Owner: tungvoduc
- License: mit
- Created: 2019-06-17T14:35:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T08:14:51.000Z (almost 5 years ago)
- Last Synced: 2024-03-14T20:04:33.512Z (almost 2 years ago)
- Topics: overlay, swift, swift-package-manager, swift5, uikit, viewcontroller
- Language: Swift
- Homepage:
- Size: 13.9 MB
- Stars: 83
- Watchers: 5
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# DTOverlayController
[](https://travis-ci.org/tungvoduc/DTOverlayController)
[](https://cocoapods.org/pods/DTOverlayController)
[](https://cocoapods.org/pods/DTOverlayController)
[](https://cocoapods.org/pods/DTOverlayController)
## Screenshots
|
|
|
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Usage
To present a view controller inside an over lay controller, simply do in your view controller:
```swift
let overlayController = DTOverlayController(viewController: viewController)
present(overlayController, animated: true, completion: nil)
```
There are other properties that you can use to customize your over lay controller. These are some of them:
```swift
let overlayController = DTOverlayController(viewController: viewController)
// View controller is automatically dismissed when you release your finger
overlayController.dismissableProgress = 0.4
// Enable/disable pan gesture
overlayController.isPanGestureEnabled = false
// Update top-left and top-right corner radius
overlayController.overlayViewCornerRadius = 10
// Control the height of the view controller
overlayController.overlayHeight = .dynamic(0.8) // 80% height of parent controller
overlayController.overlayHeight = .static(300) // fixed 300-point height
overlayController.overlayHeight = .inset(50) // fixed 50-point inset from top
```
You can check more of these configurations in the library. `DTOverlayController`
will be further developed and new features will be coming in next releases. Feel free to contribute or suggest improvements by creating issues.
## Requirements
- iOS 9.0+
## Installation
### CocoaPods
Add the following line to your Podfile:
```ruby
pod 'DTOverlayController'
```
### Swift package manager
`DTOverlayController` is available for SPM from version `1.0.2`.
Add the following to the dependencies of your `Package.swift`:
```swift
.package(url: "https://github.com/tungvoduc/DTOverlayController", from: "1.0.x")
```
## Author
Tung Vo, tung98.dn@gmail.com
## License
DTOverlayController is available under the MIT license. See the LICENSE file for more info.
## Feedbacks & requests
- Open an issue if you find a bug, make a proposal or simply need some help.
- You can also contact me via [email](mailto:tung98.dn@gmail.com).