- Simple Popup ContentView in iOS
- iOS 8.0+
- Swift 4.0
- Swift 3.0 (0.0.1)
KUIPopupController is available through CocoaPods. To install it, simply add the following line to your Podfile:
use_frameworks!
pod "KUIPopupController"
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)
}
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 |
import KUIPopupController
class ContentView: UIView, KUIPopupContentViewProtocol {
var animator: KUIPopupContentViewAnimator?
}
...
func showContentView {
let view = ContentView()
view.animator = KUIPopupContentViewAnimator
view.show()
}
Taeun Kim (kofktu), kofktu@gmail.com
KUIPopupController is available under the MIT
license. See the LICENSE
file for more info.