Git Product home page Git Product logo

glextendedwebview's Introduction

GLExtendedWebView

Branch Status
master BuddyBuild
develop BuddyBuild

Language Supported platforms codebeat badge license

What it is

GLExtendedWebView is a drop-in, ready to use, WKWebView subclass that brings Interface Builder compatibility to WKWebView, something that Apple seems to have forgot.

Why I created it

If you try to create a WKWebView using Interface Builder and you look for it in the object library the only thing you would find is UIWebView which Apple itself does not recommend:

From Apple's WKWebView documentation:

Important

Starting in iOS 8.0 and OS X 10.10, use WKWebView to add web content to your app. Do not use UIWebView or WebView.

another thing you would try at this point is to create a UIView and change its class to WKWebView but also won't work because the required method:

init?(coder: NSCoder)

has not been implemented in WKWebView. So in the end you will probably end up creating it programmatically in your UIViewController, but, unless you also apply some NSLayoutConstraints manually, it won't fit the screen on every device and/or update automatically upon rotation.

How to use / Installation

  1. Download the project
  2. Add the GLExtendedWebView class to your project
  3. Add a UIView in your UIViewController
  4. Change the UIView class to GLExtendedWebView
  5. Apply the required NSLayoutConstraint using the Interface Builder

Requirements

  • Xcode 9.0+
  • Swift 4.0+
  • iOS 9.0+

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.