Skip to content

rafaelmaeuer/NJKWebViewProgress

 
 

Repository files navigation

NJKWebViewProgress

NJKWebViewProgress was a progress interface library for UIWebView, as it doesn't had official progress interface in iOS 7. This version is updated to use WKWebView instead, to let old projects pass AppStore-Upload with UIWebView deprecation. You can implement progress bar for your in-app browser using this module.

iOS ScreenShot 1

iOS ScreenShot 1

NJKWebViewProgress doesn't use CocoaTouch's private methods. It's AppStore safe.

Info

Version 0.3.3

Features

  • Loading progress
  • Download progress
  • WKWebView
  • Dark Mode

Requirements

  • iOS 12.0 or later
  • ARC

Usage

Instance NJKWebViewProgress and set WKNavigationDelegate. If you set webViewProxyDelegate, NJKWebViewProgress should perform as a proxy object.

_progressProxy = [[NJKWebViewProgress alloc] init]; // instance variable
webView.navigationDelegate = _progressProxy;
_progressProxy.webViewProxyDelegate = self;
_progressProxy.progressDelegate = self;

When WKWebView start loading, NJKWebViewProgress call delegate method and block with progress.

-(void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress
{
    [progressView setProgress:progress animated:NO];
}
progressProxy.progressBlock = ^(float progress) {
    [progressView setProgress:progress animated:NO];
};

You can determine the current state of the document by comparing the progress value to one of the provided constants:

-(void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress
{
    if (progress == NJKInteractiveProgressValue) {
        // The web view has finished parsing the document,
        // but is still loading sub-resources
    }
}

This repository contains iOS 7 Safari style bar NJKWebViewProgressView. You can choose NJKWebViewProgressView, UIProgressView or your custom bar.

Install

CocoaPods

pod 'NJKWebViewProgress', :git => 'https://github.com/rafaelmaeuer/NJKWebViewProgress.git'

Used in Production

License

MIT license.

About

WKWebView progress interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 96.3%
  • Ruby 3.7%