Skip to content

Commit 5a7e4ea

Browse files
committed
Merge branch 'master' of https://github.com/devSC/WSProgressHUD
2 parents 7feed2b + f0b862f commit 5a7e4ea

File tree

14 files changed

+53
-26
lines changed

14 files changed

+53
-26
lines changed

Demo/WSProgressHUD.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Demo/WSProgressHUD/MMMaterialDesignSpinner.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ FOUNDATION_EXPORT const unsigned char MMMaterialDesignSpinnerVersionString[];
3333
/** Property indicating whether the view is currently animating. */
3434
@property (nonatomic, readonly) BOOL isAnimating;
3535

36+
@property (nonatomic, strong) UIColor *spinnerColor;
3637
/**
3738
* Convenience function for starting & stopping animation with a boolean variable instead of explicit
3839
* method calls.

Demo/WSProgressHUD/MMMaterialDesignSpinner.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,17 @@ - (void)updatePath {
169169
- (CAShapeLayer *)progressLayer {
170170
if (!_progressLayer) {
171171
_progressLayer = [CAShapeLayer layer];
172-
_progressLayer.strokeColor = self.tintColor.CGColor;
172+
_progressLayer.strokeColor = [UIColor blueColor].CGColor;
173173
_progressLayer.fillColor = nil;
174174
_progressLayer.lineWidth = 1.5f;
175175
}
176176
return _progressLayer;
177177
}
178+
- (void)setSpinnerColor:(UIColor *)spinnerColor
179+
{
180+
self.progressLayer.strokeColor = spinnerColor.CGColor;
181+
}
182+
178183

179184
- (BOOL)isAnimating {
180185
return _isAnimating;
1.21 KB
Loading
1.02 KB
Loading

Demo/WSProgressHUD/WSProgressHUD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ typedef NS_ENUM(NSInteger, WSProgressHUDMaskWithoutType) { //
2323
};
2424

2525
typedef NS_ENUM(NSInteger, WSProgressHUDIndicatorStyle) {
26-
WSProgressHUDIndicatorMMSpinner,
2726
WSProgressHUDIndicatorCustom,
27+
WSProgressHUDIndicatorMMSpinner,
2828
WSProgressHUDIndicatorSmallLight,
2929
};
3030

Demo/WSProgressHUD/WSProgressHUD.m

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ @interface WSProgressHUD ()
6969
static UIImage *WSProgressHUDSuccessImage;
7070
static UIImage *WSProgressHUDErrorImage;
7171

72-
static CGFloat const WSProgressHUDIndicatorBig = 35;
72+
static CGFloat const WSProgressHUDIndicatorBig = 31;
7373
static CGFloat const WSProgressHUDIndicatorSmall = 20;
7474

7575
static CGFloat WSProgressHUDRingThickness = 2;
@@ -341,15 +341,14 @@ - (void)showProgress:(CGFloat)progress status:(NSString*)string maskType:(WSProg
341341
self.ringLayer.strokeEnd = progress;
342342
return;
343343
}
344-
345344
objc_setAssociatedObject(self, @selector(maskType), @(maskType), OBJC_ASSOCIATION_ASSIGN);
346345
objc_setAssociatedObject(self, @selector(hudType), @(WSProgressHUDTypeProgress), OBJC_ASSOCIATION_ASSIGN);
347346
objc_setAssociatedObject(self, @selector(withoutType), @(withoutType), OBJC_ASSOCIATION_ASSIGN);
347+
348348
[self invalidateTimer];
349349

350350
[self setMaskEdgeWithType:self.maskType];
351351

352-
353352
[self updateSubviewsPositionWithString:string];
354353

355354
[self showHudViewWithAnimation];
@@ -567,6 +566,7 @@ - (void)updateSubviewsPositionWithString: (NSString *)string
567566
WSProgressHUDStringRect.origin.y = imageOffset;
568567
[self startIndicatorAnimation:NO];
569568
self.labelView.center = CGPointMake(hudCenterX , hudCenterY + 20);
569+
self.labelView.textAlignment = NSTextAlignmentCenter;
570570
self.imageView.center = CGPointMake(hudCenterX, 30);
571571
} else {
572572
self.labelView.text = string;
@@ -982,7 +982,7 @@ - (void)drawRect:(CGRect)rect
982982
switch (self.maskType) {
983983
case WSProgressHUDMaskTypeClear: {
984984
CGContextRef context = UIGraphicsGetCurrentContext();
985-
[[UIColor colorWithWhite:0 alpha:0.5] set];
985+
[[UIColor clearColor] set];
986986
CGRect bounds = self.bounds;
987987
CGContextFillRect(context, bounds);
988988
}break;
@@ -1155,11 +1155,6 @@ - (UIImageView *)imageView
11551155
if (!_imageView) {
11561156
_imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)];
11571157
_imageView.hidden = YES;
1158-
if ([_imageView respondsToSelector:@selector(setTintColor:)]) {
1159-
[_imageView setTintColor:WSProgressHUDForeGroundColor];
1160-
} else {
1161-
1162-
}
11631158
}
11641159
return _imageView;
11651160
}
@@ -1181,7 +1176,7 @@ - (MMMaterialDesignSpinner *)spinnerView
11811176
if (!_spinnerView) {
11821177
_spinnerView = [[MMMaterialDesignSpinner alloc] initWithFrame:CGRectZero];
11831178
_spinnerView.bounds = CGRectMake(0, 0, 20, 20);
1184-
_spinnerView.tintColor = WSProgressHUDForeGroundColor;
1179+
[_spinnerView setSpinnerColor:[UIColor whiteColor]];
11851180
}
11861181
return _spinnerView;
11871182
}

Demo/WSProgressHUDDemo/ViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ - (IBAction)show:(id)sender {
4747
// [WSProgressHUD setProgressHUDIndicatorStyle:WSProgressHUDIndicatorCustom];
4848
[WSProgressHUD showWithMaskType:WSProgressHUDMaskTypeBlack];
4949

50-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.7 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
50+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10.7 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
5151
[WSProgressHUD dismiss];
5252
});
5353
}

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ This is a beauful hud view for iPhone & iPad
1313
To Download the project. Run the WSProgressHUD.xcodeproj in the demo directory.
1414

1515
``` objc
16+
17+
[WSProgressHUD show];
18+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
19+
...
20+
21+
dispatch_async(dispatch_get_main_queue(), ^{
22+
...
23+
[WSProgressHUD dismiss];
24+
});
25+
});
26+
1627
//Show on the self.view
1728

1829
@implementation ViewController
@@ -76,7 +87,13 @@ it, simply add the following line to your Podfile:
7687
7788
```ruby
7889
pod "WSProgressHUD"
90+
7991
```
92+
## Manually
93+
94+
Drag the WSProgressHUD/Demo/WSProgressHUD folder into your project.
95+
Then take care that WSProgressHUD.bundle is added to Targets->Build Phases->Copy Bundle Resources.
96+
Add the QuartzCore framework to your project.
8097

8198
##Thanks
8299

WSProgressHUD.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "WSProgressHUD"
19-
s.version = "1.0.5"
19+
s.version = "1.0.6"
2020
s.summary = "WSProgressHUD is a beauful hud view for iPhone & iPad."
2121

2222
s.description = <<-DESC
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
3434

3535
s.author = { "袁仕崇" => "[email protected]" }
3636
s.platform = :ios, "6.0"
37-
s.source = { :git => "https://github.com/devSC/WSProgressHUD.git", :tag => "1.0.5" }
37+
s.source = { :git => "https://github.com/devSC/WSProgressHUD.git", :tag => "1.0.6" }
3838
s.source_files = "WSProgressHUD/*"
3939
s.exclude_files = "Demo/Exclude"
4040

0 commit comments

Comments
 (0)