PTPopupWebView is a simple and useful WebView for iOS, which can be popup and has many of the customized item.

Overview

PTPopupWebView

Version License Platform

PTPopupWebView is a simple and useful WebView for iOS, which can be popup and has many of the customized item. Pop

Requirement

iOS 8.0

Installation

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

use_frameworks!
pod "PTPopupWebView"

Usage

To use this library, there are two ways,

  1. Use PTPopupWebViewController, this is simple when use as modal popup.
  2. Directly use PTPopupWebView.

Details, see the Demo and the Class Reference.

Class Reference

Class Reference

Demo

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

Introduction

At first, to popup webpage is only code below.

let popupvc = PTPopupWebViewController()
popupvc.popupView.URL(string: "https://github.com/")
popupvc.show()

Popup Transition Style

Popup Appear/Disappear Style can be changed as below.

// Pop Style (default transition style. 1st parameter is animation duration, and 2nd is using spring animation flag.)
let popupvc = PTPopupWebViewController()
    .popupAppearStyle(.Slide(.Bottom, 0.4, true))
    .popupDisappearStyle(.Slide(.Bottom, 0.4, true))
// Spread Style (parameter is animation duration)
let popupvc = PTPopupWebViewController()
    .popupAppearStyle(.Spread(0.25))
    .popupDisappearStyle(.Spread(0.25))
// Slide Style (1st parameter is direction, 2nd is animation duration, and 3rd is using spring animation flag.)
let popupvc = PTPopupWebViewController()
    .popupAppearStyle(.Slide(.Bottom, 0.4, true))
    .popupDisappearStyle(.Slide(.Bottom, 0.4, true))
// Fade Style (parameter is animation duration)
let popupvc = PTPopupWebViewController()
    .popupAppearStyle(.Fade(0.25))
    .popupDisappearStyle(.Fade(0.25))
// Without Transition Style
let popupvc = PTPopupWebViewController()
    .popupAppearStyle(.None)
    .popupDisappearStyle(.None)
Pop Spread Slide
Pop Spread Slide
Fade None
Fade Introduction

Custom Action

Custom action button can do user defined action with PTPopupWebViewButton's handler property.

popupvc.popupView
    // add custom action button
    .addButton(
        PTPopupWebViewButton(type: .Custom)
            .title("custom"))
            .handler() {
                // write handler code here

                // this demo show alert view
                let alert:UIAlertController = UIAlertController(title: "Custom Action",message: popupvc.popupView.webView.title!,preferredStyle: UIAlertControllerStyle.Alert)
                alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
                popupvc.presentViewController(alert, animated: true, completion: nil)
            }
    // add close button
    .addButton(PTPopupWebViewButton(type: .Close).title("close"))
popupvc.show()
Custom Action
Custom Action

View Style

Details code reference to the source code of the demo application.

Title Style
Colored Title Hide Title
Colored Title Hide Title
Button Style
Colored Button Custom Image Button Hide Button
Colored Button Custom Image Button Hide Button
Other Style
FullScreen With Frame
FullScreen With Frame

Author

Takeshi Watanabe, [email protected]

License

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

You might also like...
WWFortuneWheelView - A scroll wheel that can be customized.
WWFortuneWheelView - A scroll wheel that can be customized.

WWFortuneWheelView A scroll wheel that can be customized. 一個可以自訂數量的滾輪. Installation with Swift Package Manager dependencies: [ .package(url: "http

Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.

I've built out the Swift version of this library! Screenshots Description ABMediaView can display images, videos, as well as now GIFs and Audio! It su

Dice roller, character sheet/ creator, and monster/item info app on the iphone12

DnD-LordDogMaw This file will be the start of a side project in the hopes of creating an iphone12 app for Dungeons and Dragons! This app will have 3 m

Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.
Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.

Easy to implement controller with expanding menu items. Design is very similar to iOS native ActionSheet presentation style of a UIAlertController. As

slider view for choosing categories. add any UIView type as category item view. Fully customisable
slider view for choosing categories. add any UIView type as category item view. Fully customisable

CategorySliderView Horizontal or vertical slider view for choosing categories. Add any UIView type as category item view. Fully customisable Demo Inst

Example usage of FingerprintJS Pro inside a iOS WebView.
Example usage of FingerprintJS Pro inside a iOS WebView.

FingerprintJS Pro iOS Integrations An example app and packages demonstrating FingerprintJS Pro capabilities on the iOS platform. The repository illust

Example usage of FingerprintJS Pro inside a iOS WebView.
Example usage of FingerprintJS Pro inside a iOS WebView.

FingerprintJS Pro iOS Integrations An example app and packages demonstrating FingerprintJS Pro capabilities on the iOS platform. The repository illust

POC for a bug with react-native-webview crashing on IOS 16.1

POC Shared Worker issues with IOS 16.1 webview Apple Developers post with workaround Webkit confirmed issue Start a simple http server with shared wor

Stateful WebView for SwiftUI.
Stateful WebView for SwiftUI.

Stateful SwiftUI WebView for iOS and MacOS Fully functional, SwiftUI-ready WebView for iOS 13+ and MacOS 10.15+. Actions and state are both delivered

Single Webview project for xcode in swift

Single Webview project for xcode in swift An xcode project that with single webview(UIWebView) that opens external URL, for hybrid web app debug or te

MacTube is a webview wrapper for YouTube for Mac OS.
MacTube is a webview wrapper for YouTube for Mac OS.

MacTube MacTube is a webview wrapper for YouTube for Mac OS. It was made for peo

This is Github user search demo app which made by many variety of design patterns.
This is Github user search demo app which made by many variety of design patterns.

iOSDesignPatternSamples This is Github user search demo app which made by many variety of design patterns. Application Structure SearchViewController.

TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes
TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes

TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes

With the Coverless App, you can discover many books of various genres
With the Coverless App, you can discover many books of various genres

Coverless Não julgue um livro pela capa: use a sinopse! Com o App Coverless, você pode descobrir muitos livros de vários gêneros. Salve seus livros de

Learn about how SoulverCore can give Swift "better than regex" data parsing features (for many common tasks)

String Parsing with Soulver Core A declarative & type-safe approach to parsing data from strings SoulverCore gives you human-friendly, type-safe & per

STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.
STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.

STPopup STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Obj

NextLevel is a Swift camera system designed for easy integration, customized media capture, and image streaming in iOS
NextLevel is a Swift camera system designed for easy integration, customized media capture, and image streaming in iOS

NextLevel is a Swift camera system designed for easy integration, customized media capture, and image streaming in iOS. Integration can optionally leverage AVFoundation or ARKit.

[iOS] Add customized buttons and toolbars to your UITextInputs.
[iOS] Add customized buttons and toolbars to your UITextInputs.

RFKeyboardToolbar This is a flexible UIView and UIButton subclass to add customized buttons and toolbars to your UITextFields/UITextViews. This projec

SwiftyKeyboard: a full customized numeric keyboard for iOS
SwiftyKeyboard: a full customized numeric keyboard for iOS

SwiftyKeyboard Overview SwiftyKeyboard is an iOS customized enhanced keyboard. T

Comments
  • Update button state also on change of URL or load

    Update button state also on change of URL or load

    Currently button state is not updated on changes of properties "URL" and "load" of webView. When navigating within one single page (e.g. with a "fraction"-Link like href="#xyz") no page has to be loaded which means the estimatedProgress and buttons are not updated.

    opened by 5b5 0
  • Warning message: Result of call to 'URL' is unused

    Warning message: Result of call to 'URL' is unused

    The library works perfectly, as I only get a warning message saying Result of call to 'URL' is unused for the function shown below:

    open func URL(string urlString: String) -> Self { URL(Foundation.URL(string: urlString)) return self }

    screen shot 2017-06-17 at 7 26 59 am And also any place where I make the call to popup the webview giving it the specified URL.

    xcode version: Version 8.3.2 (8E2002)

    Thanks Joseph

    opened by umoruj 0
  • Not support local HTML string file.

    Not support local HTML string file.

    Can not load the local HTML file. `

            let pathString = Bundle.main.path(forResource: "licenses", ofType: "html")
    
            let popupvc = PTPopupWebViewController()
    
            popupvc.popupView.URL(string: pathString!)
    
            popupvc.show()
    

    `

    opened by britzlieg 0
Owner
Takeshi Watanabe
Takeshi Watanabe
A drop-in inline browser for your Swift iOS app.

SwiftWebVC SwiftWebVC is a simple inline browser for your Swift iOS app. SwiftWebVC features: iPhone and iPad distinct UIs Full landscape orientation

Myles Ringle 314 Dec 22, 2022
A drop-in inline browser for your iOS app.

SVWebViewController SVWebViewController is a simple inline browser for your iOS 7 app. SVWebViewController features: iPhone and iPad distinct UIs full

Transit 2.6k Dec 14, 2022
Quick Symlink - a Finder extension which provides a contextual menu item for the symbolic links creation on macOS

Quick Symlink The Quick Symlink is a Finder extension which provides a contextual menu item for the symbolic links (and other links) creation on macOS

Alexander Kropotin 29 Dec 20, 2022
Bar Button Item that can be moved anywhere in the screen, like Android's stickers button.

FlowBarButtonItem Bar Button Item that can be moved anywhere in the screen, like Android's stickers button. [![CI Status](http://img.shields.io/travis

noppefoxwolf 153 Sep 15, 2022
A Swift Popup Module help you popup your custom view easily

JFPopup JFPopup is a Swift Module help you popup your custom view easily. Support 3 way to popup, Drawer, Dialog and BottomSheet. Example To run the e

逸风 77 Dec 14, 2022
WebViewKit adds a WebView to SwiftUI, that can be used to present local and online web pages

WebViewKit adds a WebView to SwiftUI, that can be used to present local and online web pages

Daniel Saidi 32 Dec 19, 2022
JDSwiftMap is an IOS Native MapKit Library. You can easily make a highly customized HeatMap.

JDSwiftMap is an IOS Native MapKit Library. You can easily make a highly customized HeatMap. Installation Cocoapods pod 'JDSWiftHeatMap' Usage JDSwi

郭介騵 135 Dec 26, 2022
An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.

CZImageEditor CZImageEditor is an instagram-like image editor with clean and intuitive UI. It is pure swift and can apply preset filters and customize

null 8 Dec 16, 2022
Pop-up based view(e.g. alert sheet), can be easily customized.

MMPopupView 中文介绍 A basic Pop-Up Kit allows you to easily create Pop-Up view. You can focus on the only view you want to show. Besides, it comes with 2

ralph li 2.1k Jan 3, 2023