Latest 0.0.1
Homepage https://github.com/VolleyZ/ETPopupView
License MIT
Platforms ios 8.0
Dependencies SnapKit
Authors

[CocoaPods]()
[CocoaPods]()
[CocoaPods]()

Swift version of MMPopupView.

demo

Installation

The preferred way of installation is via CocoaPods. Just add

pod 'ETPopupView'

and run pod install. It will install the most recent version of ETPopupView.

Usage

If you want to create your own Pop-Up view,simply you only need to subclass from ETPopupView.


class CustomView: ETPopupView {

    let SCREEN_WIDTH = UIScreen.main.bounds.width

    override func awakeFromNib() {
        super.awakeFromNib()

        animationDuration = 0.3
        type = .alert

        ETPopupWindow.sharedWindow().touchWildToHide = true

        self.snp.makeConstraints { (make) in
            make.width.equalTo(SCREEN_WIDTH*0.8)
            make.height.equalTo(214)
        }
    }
}

after you customize it, you can simply use it.


  let customView = Bundle.main.loadNibNamed("CustomView", owner: nil, options: nil)?.first as! CustomView
  customView.show()

ETPopupView is a basic Pop-Up view designed to be subclassed.
It provide 3 kind of animations(alert, sheet´╝îDrop), or you can provide your own animation by override the showAnimation and hideAnimation.

enum ETPopupType {
    case alert
    case sheet
    case custom
}

typealias ETPopupBlock = (ETPopupView) -> Void
typealias ETPopupCompletionBlock = (ETPopupView, Bool) -> Void

class ETPopupView: UIView {

    open var type: ETPopupType = .alert

    open var animationDuration: TimeInterval = 0.3

    open var visible: Bool

    open var attachedView: UIView

    open var showCompletionBlock: ETPopupCompletionBlock?
    open var hideCompletionBlock: ETPopupCompletionBlock?

    open var showAnimation: ETPopupBlock?
    open var hideAnimation: ETPopupBlock?
}

Contributing

  1. Create an issue to discuss about your idea
  2. Fork it (https://github.com/VolleyZ/ETPopupView/fork)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

Latest podspec

{
    "name": "ETPopupView",
    "version": "0.0.1",
    "summary": "swift-version MMPopupView.",
    "homepage": "https://github.com/VolleyZ/ETPopupView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "VolleyZ": "[email protected]"
    },
    "source": {
        "git": "https://github.com/VolleyZ/ETPopupView.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "Classes",
        "Classes/*.{h,m}"
    ],
    "dependencies": {
        "SnapKit": [
            "~> 3.2.0"
        ]
    },
    "platforms": {
        "ios": "8.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This