Latest 0.0.6
Homepage https://github.com/blurryssky/BSPopoverController
License MIT
Platforms ios 8.0
Authors

use BSPopoverController to custom the popover view and animations

Overview

BSPopoverControllerGIF.gif

Installation

pod ‘BSPopoverController’, ‘~> 0.0.6’

Usage

You may need to custom the animations and the view it display, and some optional properties

let poppver: UIView = NSBundle.mainBundle().loadNibNamed("PopoverView", owner: nil, options: nil).first! as! PopoverView
poppver.alpha = 0
poppver.frame = CGRectMake(0, 0, 300, 300)
poppver.center = self.popoverController.view.center

let popoverController: BSPopoverController = BSPopoverController()

//optional properties
popoverController.tapGestureEnabled = true
popoverController.maskColor = UIColor.blackColor().colorWithAlphaComponent(0.3)

// add '[unowned self] in' if revoke self
popoverController.showAnimations = { [unowned self] in
    self.alertView.alpha = 1
}

popoverController.showCompletion = { _ in

    print("did show!--------------------------------------------n")
    print("ndid show keywindow:n")
    print(UIApplication.sharedApplication().keyWindow!)

    print("ndid show windows:n")
    for window in UIApplication.sharedApplication().windows {
        print("n")
        print(window)
    }
}

popoverController.dismissAnimations = { [unowned self] in
    self.alertView.alpha = 0
}

popoverController.dismissCompletion = { _ in
    print("did dismiss!-----------------------------------------n")
    print("ndid dismiss keywindow:n")
    print(UIApplication.sharedApplication().keyWindow!)

    print("ndid dismiss windows:n")
    for window in UIApplication.sharedApplication().windows {
        print("n")
        print(window)
    }
}

//set the display view
popoverController.view.addSubview(poppverView)

Display

//do something to prepare show
print("noriginal keywindow:n")
print(UIApplication.sharedApplication().keyWindow!)

popoverController.show()

popoverController.dismiss()

Latest podspec

{
    "name": "BSPopoverController",
    "version": "0.0.6",
    "summary": "use BSPopoverController to custom the popover view and presentation animations",
    "description": "UIAlertController cannot custom the view, UIPopoverController cannot custom presentation style and something, use BSPopoverController to solve it",
    "homepage": "https://github.com/blurryssky/BSPopoverController",
    "license": "MIT",
    "authors": {
        "blurryssky": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/blurryssky/BSPopoverController.git",
        "tag": "0.0.6"
    },
    "source_files": [
        "BSPopoverController",
        "BSPopoverControllerSample/BSPopoverController/*"
    ],
    "exclude_files": "Classes/"
}

Pin It on Pinterest

Share This