Giter Club home page Giter Club logo

dlpanablewebview's Introduction

DLPanableWebView

Extend UIWebView to support pan left to go back gesture(like Wechat in-app browser).

In Safari, besides tap on 'back' and 'forward' button, you can pan left & right to go back and forward.

But UIWebView does not support this gesture. So I extented UIWebView to support the gesture(now only go back gesture).

扩展了UIWebView,使其支持滑动手势返回(类似微信的In-App浏览器)。

Safari里面除了点击‘前进’,‘后退’按钮,还可以通过滑动手势来前进和后退。

可惜UIWebView不支持这个手势,所以我扩展了UIWebView使其支持滑动手势返回。

#Screenshot DLPanableWebView

#Requirements

  • IOS6.1 or later
  • ARC

#Setup

  • Add 'DLPanableWebView' to your project.

  • If you are using CocoaPods:

    Add pod 'DLPanableWebView' to your Podfile

    Run pod install

  • else

    Run git clone https://github.com/agdsdl/DLPanableWebView.git to download our code.

    Add 'DLPanableWebView.h' and 'DLPanableWebView.m' to your project.

  • Add #import

#import "DLPanableWebView.h"
  • Replace your 'UIWebView' to 'DLPanableWebView'.
@interface WebViewController ()
@property (weak, nonatomic) IBOutlet DLPanableWebView *webView;
@end
  • That's it!

    Your web view now support pan back gesture.

#Delegate [Optional]

When navigate to the root page, and can not go back any more, DLPanableWebView will pass pan gesture to DLPanableWebViewHandler.

You can implement the DLPanableWebViewHandler protocol and handle the pan gesture if you want. For example, you can pop your WebViewController if you detect an pan back gesture(Check the demo).

#License

The MIT License (MIT)

dlpanablewebview's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.