KUIPopupController 1.0.0

KUIPopupController 1.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Kofktu.



  • By
  • Kofktu



  • Simple Popup ContentView in iOS

alt tag

Requirements

  • iOS 8.0+
  • Swift 4.0
  • Swift 3.0 (0.0.1)

Usage

KUIPopupContentViewProtocol

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

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

import KUIPopupController

class ContentView: UIView, KUIPopupContentViewProtocol {
    var animator: KUIPopupContentViewAnimator?
}

...

func showContentView {
  let view = ContentView()
  view.animator = KUIPopupContentViewAnimator
  view.show()
}

Authors

Taeun Kim (kofktu), [email protected]

License

KUIPopupController is available under the MIT license. See the LICENSE file for more info.