Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ninjinkun/NJKWebViewProgress
UIWebView progress interface
https://github.com/ninjinkun/NJKWebViewProgress
objective-c uiwebview
Last synced: about 1 month ago
JSON representation
UIWebView progress interface
- Host: GitHub
- URL: https://github.com/ninjinkun/NJKWebViewProgress
- Owner: ninjinkun
- License: mit
- Created: 2013-04-21T18:34:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-01-04T10:42:50.000Z (about 5 years ago)
- Last Synced: 2024-10-29T15:47:35.471Z (2 months ago)
- Topics: objective-c, uiwebview
- Language: Objective-C
- Homepage:
- Size: 639 KB
- Stars: 3,895
- Watchers: 100
- Forks: 594
- Open Issues: 42
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - NJKWebViewProgress - A progress interface library for UIWebView. You can implement progress bar for your in-app browser using this module. (UI / Activity Indicator)
- awesome-ios-star - NJKWebViewProgress - A progress interface library for UIWebView. You can implement progress bar for your in-app browser using this module. (UI / Activity Indicator)
- awesome - NJKWebViewProgress - UIWebView progress interface (uiwebview)
- awesome - NJKWebViewProgress - 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. 【 [Priview](https://camo.githubusercontent.com/082fc708cc461dc53832b7d14d5affdf475dd57b/68747470733a2f2f7261772e6769746875622e636f6d2f6e696e6a696e6b756e2f4e4a4b5765625669657750726f67726573732f6d61737465722f44656d6f4170702f53637265656e73686f742f73637265656e73686f74312e706e67) 】 (OOM-Leaks-Crash / WebView-ProgressBar)
- awesome - NJKWebViewProgress - UIWebView progress interface (objective-c)
README
# NJKWebViewProgress
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
- [Yahoo! JAPAN](https://itunes.apple.com/app/yahoo!-japan/id299147843?mt=8)
- [Facebook](https://itunes.apple.com/app/facebook/id284882215?mt=8)# Requirements
- iOS 4.3 or later
- ARC# Usage
Instance `NJKWebViewProgress` and set `UIWebViewDelegate`. If you set `webViewProxyDelegate`, `NJKWebViewProgress` should perform as a proxy object.```objc
_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.
```objc
-(void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress
{
[progressView setProgress:progress animated:NO];
}
``````objc
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:
```objc
-(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'
```# License
[Apache]: http://www.apache.org/licenses/LICENSE-2.0
[MIT]: http://www.opensource.org/licenses/mit-license.php
[GPL]: http://www.gnu.org/licenses/gpl.html
[BSD]: http://opensource.org/licenses/bsd-license.php
[MIT license][MIT].