Skip to content

Latest commit

 

History

History
81 lines (65 loc) · 3.67 KB

PTPopupWebViewController.md

File metadata and controls

81 lines (65 loc) · 3.67 KB

Class PTPopupWebViewController

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().

Property Type Descrption Default
backgroundStyle PTPopupWebViewControllerBackgroundStyle Background style. .BlurEffect(.Dark)
transitionStyle UIModalTransitionStyle Modal Trantision style. .CrossDissolve
popupAppearStyle PTPopupWebViewControllerTransitionStyle Appearing Transition Style of popup. .Pop(0.3, true)
popupDisappearStyle PTPopupWebViewControllerTransitionStyle Disappearing Transition Style of popup. .Pop(0.3, true)
popupView PTPopupWebView [read only property]
Use this property to access PTPopupWebView.

Methods

Method Name Return Type Descrption
show Void Show the popup view.
close Void Close the popup view and dismiss PTPopupWebViewController.

PTPopupWebViewControllerBackgroundStyle

Enum of PTPopupWebViewControllerBackgroundStyle is defined as below.

Definition Arguments Description
BlurEffect UIBlurEffectStyle Blur effect background.
Opacity UIColor? Opacity background.
Transparent Transparent background.

PTPopupWebViewControllerTransitionStyle

Enum of PTPopupWebViewControllerTransitionStyle is defined as below.

Definition Arguments Description
Pop NSTimeInterval, Bool Transition with pop out/in style with content scalling. The argument is animation duration.
Spread NSTimeInterval Transition with spread out/in style without content scalling. The argument is animation duration.
Slide PTPopupWebViewEffectDirection, NSTimeInterval, Bool Transition with slide in/out effect. First argument is slide direction, second is animation duration, third is to use or not spring effect.
Fade NSTimeInterval Transition with fade in/out effect. The argument is animation duration.
None Transition without style.

PTPopupWebViewEffectDirection

Enum of PTPopupWebViewEffectDirection is defined as below.

Definition Description
Top Top direction.
Bottom Bottom direction.
Left Top direction.
Right Right direction.