NJKWebViewProgress
  • September 24, 2023

NJKWebViewProgress is a progress interface library for UIWebView. Currently, UIWebView doesn’t have official progress interface. You can implement progress bar for your in-app browser using this module.

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

Used in Production


Requirements


  • iOS 4.3 or later
  • ARC

Usage


Instance NJKWebViewProgress and set UIWebViewDelegate. If you set webViewProxyDelegateNJKWebViewProgress should perform as a proxy object.

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

When UIWebView 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 NJKWebViewProgressViewUIProgressView or your custom bar.

Install


CocoaPods


pod ‘NJKWebViewProgress’

GitHub


View Github

#objectivec #uiwebview
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...