测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布上次发布 | 2017年9月 |
SwiftSwift 版本 | 4.0 |
SPM支持 SPM | ✗ |
由 Kofktu 维护。
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
属性 | 类型 | 描述 |
---|---|---|
isShow |
Bool |
如果值为 true,显示状态 |
contentView |
UIView |
自定义视图 |
containerView |
UIView |
弹出容器视图 |
containerViewCenterX |
NSLayoutConstraint |
容器视图居中约束 |
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), [email protected]
KUIPopupController 在 MIT
许可下可用。有关更多信息,请参阅 LICENSE
文件。