Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no sense in progress property until it is set by setProgress be... #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DemoApp.xcodeproj/project.xcworkspace/xcuserdata
DemoApp.xcodeproj/xcuserdata
1 change: 1 addition & 0 deletions DemoApp/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ -(void)loadGoogle
-(void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress
{
[_progressView setProgress:progress animated:YES];
NSAssert(progress == _progressView.progress, @"Progress is not set correctly");
self.title = [_webView stringByEvaluatingJavaScriptFromString:@"document.title"];
}

Expand Down
2 changes: 1 addition & 1 deletion NJKWebViewProgress.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Pod::Spec.new do |s|
s.summary = "UIWebView progress interface."
s.homepage = "https://github.com/ninjinkun/NJKWebViewProgress"
s.authors = { "ninjinkun" => "[email protected]" }
s.source = { :git => "https://github.com/ninjinkun/NJKWebViewProgress.git", :tag => "v#{s.version}" }
s.source = { :git => "https://github.com/AlexeyAfanasyev/NJKWebViewProgress.git" }
s.platform = :ios, '4.3'
s.requires_arc = true
s.subspec 'Core' do |ss|
Expand Down
1 change: 1 addition & 0 deletions NJKWebViewProgress/NJKWebViewProgressView.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ -(void)setProgress:(float)progress

- (void)setProgress:(float)progress animated:(BOOL)animated
{
_progress = progress;
BOOL isGrowing = progress > 0.0;
[UIView animateWithDuration:(isGrowing && animated) ? _barAnimationDuration : 0.0 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
CGRect frame = _progressBarView.frame;
Expand Down