Code Monkey home page Code Monkey logo

njkwebviewprogress's People

Contributors

christianroman avatar cutmail avatar dismory avatar jarinosuke avatar ksjun avatar modocache avatar ninjinkun avatar wcwynn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

njkwebviewprogress's Issues

incrementProgress confuse me

In the incrementProgress method, two line code confuse me.

I think
float maxProgress = _interactive ? NJKFinalProgressValue : NJKInteractiveProgressValue;
should be
float maxProgress = _interactive ? NJKInteractiveProgressValue: NJKFinalProgressValue;

and

float increment = (maxProgress - progress) * remainPercent;
should be
float increment = (maxProgress - progress) * (1-remainPercent);

Do I think wrong?

Why can't write their own progress bar color?

Why can't write their own progress bar color?The forehead If the default white The progress of color can be But in the actual development Don't play may be the color So the color of the progress bar can be set up was more important Although can write directly in the source code file But there are still interface is better This is my suggestion Thank you very much

Progress on new sites (like airbnb tablet site)

Hello,

I think your control is great and would love to use it but some new sites (airbnb on iPad iOS 8.0) gets stuck at 50%.

Could you please have a look, or maybe point out what goes wrong.
Thanks,
R.

How to use in WKWebView ?

How to use in WKWebView ?

how to set delegate (WKWebview have WKNavigationDelegate and WKUIDelegate)

use with WKWebvView?

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

Apparently, WKWebView doesn't have a delegate .

How do you use NJKWebViewProgress with WKWebView?

Add maintainers?

Hey @ninjinkun, this is a great library but I have noticed that you are not merging pull requests any more.

Perhaps you can add other maintainers who can merge them? :)

UIWebView not releasing memory when using NJKWebViewProgress

in my dealloc i do

self.loadingProgress.webViewProxyDelegate = nil;
self.loadingProgress.progressDelegate = nil;
self.loadingProgress = nil;    
[self.webView loadHTMLString:@"" baseURL:nil];
[self.webView stopLoading];
self.webView.delegate = nil;
[self.webView removeFromSuperview];

but still i'am getting incrementing memory when loading a new webview... by not using NJKWebViewProgress i get a steady memory use... looks like there is some stonrg refference to the webview which doesn't allow it to be fred

Why the web view is below the navigation bar if we don't use storyboard?

The demo app which use storyboard to create the UIWebView runs fine as follows.

right

However, if I change the UIWebView to be created programmatically, some part of the view is below the navigation bar which cannot be seen. Following image shows the result.

wrong

Following code shows how the UIWebView is created.

@implementation ViewController
{
//    IBOutlet __weak UIWebView *_webView;
    UIWebView *_webView;
    NJKWebViewProgressView *_progressView;
    NJKWebViewProgress *_progressProxy;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    _webView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.view addSubview:_webView];
    ......
}

tintColor not found in ios6.1 or earlier

i simply changed the "Deployment Target" to ios6.1 or earlier version, and the demo app build failed :(

"Property 'tintColor' not found on object of type 'UIWindow'" @NJKWebViewProgressView.m line 21-22

xcode 5.1
os 10.8.4

Imprecise progress display

I am using NJKWebViewProgress to display page loading progress inside web browser. When loading large web pages (http://lifehacker.com for example) progress bar freezes for a long time and then, after the whole page appears, goes to 100%.

I saw your implementation - it tracks only page loading completion event. So, after some research I found the way to make progress more precise. It can be achieved by monitoring all AJAX requests (http://stackoverflow.com/questions/5353278/uiwebviewdelegate-not-monitoring-xmlhttprequest) on a page.
Even more, each AJAX request progress can be also monitored using progress event (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest)
As far as I see, Facebook has already implemented it in their internal browser, as their loading progress works very smooth and precise while page is loading

What do you think about it?

Progress not working on local html files loaded with loadRequest:

Hey,
It seems to me that only http and https schemes are currently supported and this makes urls starting with file:// not work with the progress mechanism. Am I correct or missing something?
This could be useful for local HTML strings for example. Using a file instead of loadHTMLString:
Anyway I added this line of code and a pull request ready if needed ;)

BOOL isHTTPOrLocalFile = [request.URL.scheme isEqualToString:@"http"] || [request.URL.scheme isEqualToString:@"https"] || [request.URL.scheme isEqualToString:@"file"];

bug(njkwebviewprogressproxy/complete)404

if (interactive) {
_interactive = YES;
NSString *waitForCompleteJS = [NSString stringWithFormat:@"window.addEventListener('load',function() { var iframe = document.createElement('iframe'); iframe.style.display = 'none'; iframe.src = '%@://%@%@'; document.body.appendChild(iframe); }, false);", webView.request.mainDocumentURL.scheme, webView.request.mainDocumentURL.host, completeRPCURLPath];
[webView stringByEvaluatingJavaScriptFromString:waitForCompleteJS];
} Turn mainDocumentURL.host into an empty string or other domain name

How do I implement this?

Hi, how do I implement the NJKWebViewProgress into a custom Navigation Bar within my UIWebView programmatically? I can't seem to implement it into my view controller or Navigation Bar. Can you help?

Adjustable Progress Color of ProgressBar

Next to the issue #11 dealing with device rotation, NJKWebViewProgress lacks a possibility to set a custom bar color by code (i.e. the color showing the progress, here: defaults to blue).

Compared to https://github.com/MobileMakersAcademy/SuProgress where I can override the progress animation color by a simple:

[self.SuProgressBar setBackgroundColor:[UIColor greenColor]];

Sticking for now to SuProgress, but I like the idea of using NJKWebViewProgress together with NJKScrollFullSreen to implement a safari-like iOS7 UX.

Expand unit tests

Here is my unit tests plan.

  • Add redirect test case
  • Add file:// test case
  • Use embed web server instead of direct web access

Can I change bar color

Is there any way to change the color of the bar?
I found only a way to change the background color.
I would appreciate your advice.

Add <UIKit/UIKit.h> to NJKWebViewProgress.h

Hello.

If you make a brand new project in Xcode, and add NJKWebViewProgress.h, it will fail to compile with:

/MyApp/SDKs/NJKWebViewProgress/NJKWebViewProgress.h:23:42: Cannot find protocol declaration for 'UIWebViewDelegate'

My guess is XCode now longer includes precompiled headers in new projects.

If you add <UIKit/UIKit.h> to NJKWebViewProgress.h, it compiles fine.

//
//  NJKWebViewProgress.h
//
//  Created by Satoshi Aasano on 4/20/13.
//  Copyright (c) 2013 Satoshi Asano. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

Thanks,
-- Jason

support loadHTMLString

Hope to support - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL method

为什么不能自己写进度条的颜色

为什么不能自己写进度条的颜色? 额 要是配合默认的白色 这个进度跳的颜色可以 但是实际开发中 不打可能都是这个配色 所以 进度条的颜色可设置还是比较重要的 虽然在源代码文件可以直接写 但是还是有 接口比较好 这是我的建议 谢谢

Updating Apps that Use Web Views

如果您的应用仍使用不推荐使用的UIWebView API嵌入网络内容,我们强烈建议您尽快更新到WKWebView,以提高安全性和可靠性。WKWebView通过将Web处理限制在应用程序的Web视图中,确保受损的Web内容不会影响应用程序的其余部分。iOS和macOS以及Mac Catalyst都支持它。

自2020年4月起,App Store将不再接受使用UIWebView的新应用程序,而自2020年12月起将不再接受使用UIWebView的应用程序更新。

为什么增加waitForCompleteJS

waitForCompleteJS的执行加了后缀completeRPCURLPath,很显然这个请求不通,那么shouldStartLoadWithRequest方法中,就会执行[self completeProgress],并return NO。这样做的目的是什么?

Wrong pod file

I believe the podfile isn't correct . it is pointing to "0.2.2" and some of the new features are missing

NJKWebViewProgressView as Progress Bar on UIView

Hi,
I'm trying to use the NJKWebViewProgressView as progress on a UIView like:

- (void)viewDidLoad {
CGFloat progressBarHeight = 2.f;
    CGRect navigaitonBarBounds = self.view.bounds;
    CGRect barFrame = CGRectMake(0, progressBarHeight + 5.0 , navigaitonBarBounds.size.width, progressBarHeight);
    _progressView = [[NJKWebViewProgressView alloc] initWithFrame:barFrame];
    _progressView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
    [_progressView setProgress:0.2 animated:NO];
    [self.container addSubview:_progressView];
    //...

so without having any UIWebView delegate and trying to update the progress manually. If I try to change the progress it seems nothing happens a part in the viewDidLoad method:

-(IBAction)discover:(id)sender {

    float progress=0.5;
    dispatch_async(dispatch_get_main_queue(), ^{
        [_progressView setProgress:progress animated:YES];
    });

where self.container is a UIView.
Where I'm wrong or missing something in the code?

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.