Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kofktu/kuipopupcontroller
Simple Popup ContentView in iOS
https://github.com/kofktu/kuipopupcontroller
custom-animation ios popup simple swift
Last synced: 2 months ago
JSON representation
Simple Popup ContentView in iOS
- Host: GitHub
- URL: https://github.com/kofktu/kuipopupcontroller
- Owner: Kofktu
- License: mit
- Created: 2017-03-10T05:20:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-27T04:46:38.000Z (about 7 years ago)
- Last Synced: 2024-10-11T06:43:22.974Z (2 months ago)
- Topics: custom-animation, ios, popup, simple, swift
- Language: Swift
- Size: 1.99 MB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KUIPopupController
![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg)
[![CocoaPods](http://img.shields.io/cocoapods/v/KUIPopupController.svg?style=flat)](http://cocoapods.org/?q=name%3AKUIPopupController%20author%3AKofktu)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)- Simple Popup ContentView in iOS
![alt tag](Screenshot/Sample.gif)
## Requirements
- iOS 8.0+
- Swift 4.0
- Swift 3.0 ([0.0.1](https://github.com/Kofktu/KUIPopupController/tree/0.0.1))## Installation
#### CocoaPods
KUIPopupController is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
use_frameworks!
pod "KUIPopupController"
```## Usage
#### KUIPopupContentViewProtocol
```swift
public protocol KUIPopupContentViewProtocol {
var modalBackgroundColor: UIColor? { get } // default UIColor.black(alpha 0.6)
var animator: KUIPopupContentViewAnimator? { get }
}public extension KUIPopupContentViewProtocol where Self: UIView {
public func show(_ parentViewController: UIViewController? = nil)
public func dismiss(_ animated: Bool)
}
```#### KUIPopupContentViewAnimator
```swift
public protocol KUIPopupContentViewAnimator {
func animate(_ parameter: KUIPopupContentViewAnimatorStateParameter, completion: @escaping (Bool) -> Void)
}```
KUIPopupContentViewAnimatorStateParameter:
| Property | Type | Description |
| ---|---|---|
| `isShow` | `Bool` | if the value is true, show state |
| `contentView` | `UIView ` | custom view |
| `containerView` | `UIView` | popup container view |
| `containerViewCenterX` | `NSLayoutConstraint` | container view centerX constraint |
| `containerViewCenterY` | `NSLayoutConstraint` | container view centerY constraint |#### At a Glance
```swift
import KUIPopupControllerclass ContentView: UIView, KUIPopupContentViewProtocol {
var animator: KUIPopupContentViewAnimator?
}...
func showContentView {
let view = ContentView()
view.animator = KUIPopupContentViewAnimator
view.show()
}
```## Authors
Taeun Kim (kofktu),
## License
KUIPopupController is available under the ```MIT``` license. See the ```LICENSE``` file for more info.