Latest 1.0.0
Homepage https://github.com/Kofktu/KUIPopupController
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit
Authors

Swift
CocoaPods
Carthage compatible

  • Simple Popup ContentView in iOS

alt tag

Requirements

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

Installation

CocoaPods

KUIPopupController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

use_frameworks!
pod "KUIPopupController"

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), kofktu@gmail.com

License

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

Latest podspec

{
    "name": "KUIPopupController",
    "version": "1.0.0",
    "summary": "Simple Popup ContentView in iOS",
    "homepage": "https://github.com/Kofktu/KUIPopupController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kofktu": "kofktu@gmail.com"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Kofktu/KUIPopupController.git",
        "tag": "1.0.0"
    },
    "source_files": "KUIPopupController/Classes/**/*.{swift}",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This