Class PTPopupWebViewController

April 1, 2016 ยท View on GitHub

PTPopupWebViewController is UIViewController that wraps the PTPopupWebView.

The properties, backgroundStyle, transitionStyle, popupAppearStyle, and popupDisappearStyle are the additional from PTPopupWebView. By accessing to popupView property, it can customize PTPopupWebView's style and buttons etc.

The methods, show() and close() are used to control modal view.

Usage

PTPopupWebViewController is instantiated with initializer init().

let popupvc = PTPopupWebViewController()

Properties (except popupView property) are able to set by method propertyName().

popupvc
    .backgroundStyle(.BlurEffect(.Light))
    .transitionStyle(.CrossDissolve)
    .popupAppearStyle(.Slide(.Bottom, 0.4, true))
    .popupDisappearStyle(.Slide(.Top, 0.4, true))

Show and close the PTPopupWebViewController are able to be used the methods, show() and close().

// show popup
popupvc.show()

// close popup
popupvc.close()

Properties

All properties are able to set by method chain propertyName().

PropertyTypeDescrptionDefault
backgroundStylePTPopupWebViewControllerBackgroundStyleBackground style..BlurEffect(.Dark)
transitionStyleUIModalTransitionStyleModal Trantision style..CrossDissolve
popupAppearStylePTPopupWebViewControllerTransitionStyleAppearing Transition Style of popup..Pop(0.3, true)
popupDisappearStylePTPopupWebViewControllerTransitionStyleDisappearing Transition Style of popup..Pop(0.3, true)
popupViewPTPopupWebView[read only property]
Use this property to access PTPopupWebView.

Methods

Method NameReturn TypeDescrption
showVoidShow the popup view.
closeVoidClose the popup view and dismiss PTPopupWebViewController.

PTPopupWebViewControllerBackgroundStyle

Enum of PTPopupWebViewControllerBackgroundStyle is defined as below.

DefinitionArgumentsDescription
BlurEffectUIBlurEffectStyleBlur effect background.
OpacityUIColor?Opacity background.
TransparentTransparent background.

PTPopupWebViewControllerTransitionStyle

Enum of PTPopupWebViewControllerTransitionStyle is defined as below.

DefinitionArgumentsDescription
PopNSTimeInterval, BoolTransition with pop out/in style with content scalling. The argument is animation duration.
SpreadNSTimeIntervalTransition with spread out/in style without content scalling. The argument is animation duration.
SlidePTPopupWebViewEffectDirection, NSTimeInterval, BoolTransition with slide in/out effect. First argument is slide direction, second is animation duration, third is to use or not spring effect.
FadeNSTimeIntervalTransition with fade in/out effect. The argument is animation duration.
NoneTransition without style.

PTPopupWebViewEffectDirection

Enum of PTPopupWebViewEffectDirection is defined as below.

DefinitionDescription
TopTop direction.
BottomBottom direction.
LeftTop direction.
RightRight direction.