Latest 0.0.6
Homepage https://github.com/acsmith25/popup-view
License MIT
Platforms ios 8.0
Authors

PopupView

CI Status
Version
License
Platform

Introduction

CustomPopup allows you to modally present any view controller that dynamically sizes to its content on another in UIAlert style.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Screenshot
Screenshot

Installation

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

pod 'CustomPopup'

Usage

The controller you would like to present the pop up on should conform to the PopUpPresentationController Protocol

public protocol PopUpPresentationController {
    var gesture: UIGestureRecognizer? { get set }
    var popUp: PopUpController? { get set }
    func dismissPopUp()
}

To present the pop up:

let popUpController = YourCustomPopUpViewController()
popUp = PopUpController(popUpView: popUpController)
guard let popUp = popUp else { return }
popUp.presentPopUp(on: self)

It may be helpful to add a gesture to dismiss the pop up when a tap occurs outside the modal view:

gesture = UITapGestureRecognizer(target: self, action: #selector(dismissPopUp))
gesture?.delegate = self    //implement gestureRecognizer:shouldReceiveTouch:
guard let gesture = gesture else { return }
self.view.addGestureRecognizer(gesture)

Author

acsmith25, [email protected]

License

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

Latest podspec

{
    "name": "CustomPopup",
    "version": "0.0.6",
    "summary": "A custom modal popup view.",
    "description": "Provide your own custom pop up view to present in your applications.",
    "homepage": "https://github.com/acsmith25/popup-view",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "acsmith25": "[email protected]"
    },
    "source": {
        "git": "https://github.com/acsmith25/popup-view.git",
        "tag": "0.0.6"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "PopupView/Classes/**/*"
}

Pin It on Pinterest

Share This