Giter Club home page Giter Club logo

stkwebkitviewcontroller's Introduction

STKWebKitViewController

Version License Platform

STKWebKitViewController STKWebKitViewController

Description

This project provides a wrapping UIViewController around Apple´s new WKWebView, available as of iOS8 in WebKit. Also included is a wrapping UINavigationController to present the WKWebView modally.

Usage

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

To push a WKWebView onto your UINavigationController, do:

NSURL *url = [NSURL URLWithString:@"https://github.com/sticksen/STKWebKitViewController"];
STKWebKitViewController *controller = [[STKWebKitViewController alloc] initWithURL:url];
[self.navigationController pushViewController:controller animated:YES];

To open it modally:

NSURL *url = [NSURL URLWithString:@"https://github.com/sticksen/STKWebKitViewController"];
STKWebKitModalViewController *controller = [[STKWebKitModalViewController alloc] initWithURL:url];
[self presentViewController:controller animated:YES completion:nil];

It is possible to change the behaviour how the WKWebView opens links that would trigger a new tab opening on desktop browsers (aka. target=_blank - links). To change the behaviour, adjust newTabOpenMode to your desired choice.

It´s also possible to customize the NavigationBar and Toolbar colors.

To use the new UINavigationBar and UIToolbar hiding features of iOS8, set your navigationController to:

self.navigationController.hidesBarsOnSwipe = YES;

Requirements

WebKit, UIKit

Installation

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

pod "STKWebKitViewController"

Then include the Header somewhere in your project:

#import <STKWebKitViewController/STKWebKitViewController.h>

Author

Marc, [email protected]

License

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

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.