PopupController
PopupController is a controller for showing temporary popup view.
Demo
Try PopupController on Appetize.io
Installation
CocoaPods
pod 'PopupController'
Carthage
Future
Usage
Before use,
Every ViewController which is added on the PopupController must conform to PopupContentViewController protocol.
class AnyPopupViewController: UIViewController, PopupContentViewController {
// Do something...
private var popupSize: CGSize // define the size for showing popup view size.
// PopupContentViewController Protocol
func sizeForPopup(popupController: PopupController, size: CGSize, showingKeyboard: Bool) -> CGSize {
return popupSize
}
}
Then, show popup
let anyPopupViewController = AnyPopupViewController()
let popupController = PopupController.create(self)
popupController.presentPoopupController(anyPopupViewController, completion: nil)
With some custom.
let popupController = PopupController.create(self)
popupController.animation = .FadeIn
popupController.layout = .Top
popupController.backgroundStyle = .Blur(style: .Light)
popupController.presentPoopupController(childViewController, completion: nil)
Customization
public var layout: PopupLayout // default is .Center, [.Top/.Center/.Bottom]
public var animation: PopupAnimation // default is .SlideUp, [.Slideup/.FadeIn]
public var backgroundStyle: PopupBackgroundStyle // default is .BlackFilter(alpha: 0.4) [BlackFilter(alpha: CGFloat)/Blur]
public var scrollable: Bool // default is true
public var tappable: Bool // default is true
public var movesAlongWithKeyboard: Bool // default is true
License
PopupController is available under the MIT lincense. See the LINCENSE file for more info.