From f760c54dc971eb6ff90aebb4192eee412a2d07d8 Mon Sep 17 00:00:00 2001 From: jcgsxr Date: Thu, 6 Aug 2015 11:34:52 -0700 Subject: [PATCH 1/5] Fix color for clear mask type --- .../project.xcworkspace/contents.xcworkspacedata | 7 +++++++ Demo/WSProgressHUD/WSProgressHUD.m | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 Demo/WSProgressHUD.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Demo/WSProgressHUD.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Demo/WSProgressHUD.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Demo/WSProgressHUD.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Demo/WSProgressHUD/WSProgressHUD.m b/Demo/WSProgressHUD/WSProgressHUD.m index 5c76530..cc410b1 100644 --- a/Demo/WSProgressHUD/WSProgressHUD.m +++ b/Demo/WSProgressHUD/WSProgressHUD.m @@ -982,7 +982,7 @@ - (void)drawRect:(CGRect)rect switch (self.maskType) { case WSProgressHUDMaskTypeClear: { CGContextRef context = UIGraphicsGetCurrentContext(); - [[UIColor colorWithWhite:0 alpha:0.5] set]; + [[UIColor clearColor] set]; CGRect bounds = self.bounds; CGContextFillRect(context, bounds); }break; From bbc0b6533a052abfc8017b649a8508c57da452ba Mon Sep 17 00:00:00 2001 From: jcgsxr Date: Thu, 6 Aug 2015 11:51:45 -0700 Subject: [PATCH 2/5] Also change the non-demo framework file --- WSProgressHUD/WSProgressHUD.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WSProgressHUD/WSProgressHUD.m b/WSProgressHUD/WSProgressHUD.m index 92155f0..1049d02 100644 --- a/WSProgressHUD/WSProgressHUD.m +++ b/WSProgressHUD/WSProgressHUD.m @@ -981,7 +981,7 @@ - (void)drawRect:(CGRect)rect switch (self.maskType) { case WSProgressHUDMaskTypeClear: { CGContextRef context = UIGraphicsGetCurrentContext(); - [[UIColor colorWithWhite:0 alpha:0.5] set]; + [[UIColor clearColor] set]; CGRect bounds = self.bounds; CGContextFillRect(context, bounds); }break; From db13be0257501e4ff1f323de5fb4aa243feecd7c Mon Sep 17 00:00:00 2001 From: jcgsxr Date: Thu, 6 Aug 2015 15:34:04 -0700 Subject: [PATCH 3/5] Center-align text for image HUD type --- Demo/WSProgressHUD/WSProgressHUD.m | 1 + WSProgressHUD/WSProgressHUD.m | 1 + 2 files changed, 2 insertions(+) diff --git a/Demo/WSProgressHUD/WSProgressHUD.m b/Demo/WSProgressHUD/WSProgressHUD.m index cc410b1..e23a142 100644 --- a/Demo/WSProgressHUD/WSProgressHUD.m +++ b/Demo/WSProgressHUD/WSProgressHUD.m @@ -567,6 +567,7 @@ - (void)updateSubviewsPositionWithString: (NSString *)string WSProgressHUDStringRect.origin.y = imageOffset; [self startIndicatorAnimation:NO]; self.labelView.center = CGPointMake(hudCenterX , hudCenterY + 20); + self.labelView.textAlignment = NSTextAlignmentCenter; self.imageView.center = CGPointMake(hudCenterX, 30); } else { self.labelView.text = string; diff --git a/WSProgressHUD/WSProgressHUD.m b/WSProgressHUD/WSProgressHUD.m index 1049d02..a45b16a 100644 --- a/WSProgressHUD/WSProgressHUD.m +++ b/WSProgressHUD/WSProgressHUD.m @@ -566,6 +566,7 @@ - (void)updateSubviewsPositionWithString: (NSString *)string WSProgressHUDStringRect.origin.y = imageOffset; [self startIndicatorAnimation:NO]; self.labelView.center = CGPointMake(hudCenterX , hudCenterY + 20); + self.labelView.textAlignment = NSTextAlignmentCenter; self.imageView.center = CGPointMake(hudCenterX, 30); } else { self.labelView.text = string; From 17d8cfc8f4f5ade6bc4933a8b35076dd3e58938a Mon Sep 17 00:00:00 2001 From: YSC Date: Mon, 10 Aug 2015 14:26:15 +0800 Subject: [PATCH 4/5] Fix iOS6 Crash when setTintColor --- Demo/WSProgressHUD/MMMaterialDesignSpinner.h | 1 + Demo/WSProgressHUD/MMMaterialDesignSpinner.m | 7 ++++++- .../WSProgressBundle.bundle/error@2x.png | Bin 1137 -> 2377 bytes .../WSProgressBundle.bundle/success@2x.png | Bin 811 -> 1856 bytes Demo/WSProgressHUD/WSProgressHUD.h | 2 +- Demo/WSProgressHUD/WSProgressHUD.m | 12 +++--------- Demo/WSProgressHUDDemo/ViewController.m | 2 +- README.md | 17 +++++++++++++++++ WSProgressHUD.podspec | 4 ++-- WSProgressHUD/MMMaterialDesignSpinner.h | 1 + WSProgressHUD/MMMaterialDesignSpinner.m | 7 ++++++- WSProgressHUD/WSProgressHUD.h | 2 +- WSProgressHUD/WSProgressHUD.m | 13 ++++--------- 13 files changed, 43 insertions(+), 25 deletions(-) mode change 100755 => 100644 Demo/WSProgressHUD/WSProgressBundle.bundle/error@2x.png mode change 100755 => 100644 Demo/WSProgressHUD/WSProgressBundle.bundle/success@2x.png diff --git a/Demo/WSProgressHUD/MMMaterialDesignSpinner.h b/Demo/WSProgressHUD/MMMaterialDesignSpinner.h index ca8848d..6ad3ef3 100755 --- a/Demo/WSProgressHUD/MMMaterialDesignSpinner.h +++ b/Demo/WSProgressHUD/MMMaterialDesignSpinner.h @@ -33,6 +33,7 @@ FOUNDATION_EXPORT const unsigned char MMMaterialDesignSpinnerVersionString[]; /** Property indicating whether the view is currently animating. */ @property (nonatomic, readonly) BOOL isAnimating; +@property (nonatomic, strong) UIColor *spinnerColor; /** * Convenience function for starting & stopping animation with a boolean variable instead of explicit * method calls. diff --git a/Demo/WSProgressHUD/MMMaterialDesignSpinner.m b/Demo/WSProgressHUD/MMMaterialDesignSpinner.m index a5a2757..8d256d4 100755 --- a/Demo/WSProgressHUD/MMMaterialDesignSpinner.m +++ b/Demo/WSProgressHUD/MMMaterialDesignSpinner.m @@ -169,12 +169,17 @@ - (void)updatePath { - (CAShapeLayer *)progressLayer { if (!_progressLayer) { _progressLayer = [CAShapeLayer layer]; - _progressLayer.strokeColor = self.tintColor.CGColor; + _progressLayer.strokeColor = [UIColor blueColor].CGColor; _progressLayer.fillColor = nil; _progressLayer.lineWidth = 1.5f; } return _progressLayer; } +- (void)setSpinnerColor:(UIColor *)spinnerColor +{ + self.progressLayer.strokeColor = spinnerColor.CGColor; +} + - (BOOL)isAnimating { return _isAnimating; diff --git a/Demo/WSProgressHUD/WSProgressBundle.bundle/error@2x.png b/Demo/WSProgressHUD/WSProgressBundle.bundle/error@2x.png old mode 100755 new mode 100644 index b8bc16c896bc3667141e4b131974628f68c785d2..87534fac5fc9e065ef9b6cd1e4b62bcacc745c33 GIT binary patch literal 2377 zcmaJ@X;f3!77j?jgh|UFlQcvE0VJaV5(qVc1VWRb41y9ZA-O<+4BiA2^eL0N@QI>; z%z04JmbMU!RsjJ8D-VKzYl(s=3Ti0T3Zmfj5P89h?T_cXYu$U!KI{9wz0cm?k9%kn zH^dz70Ea*z=B&`*2>t4}^sY44f9nqVJL?yF1tV4wDNR%;`5*wH38e`Df+glB0TBRS zn6Xm}1VA7wTtrc^idYVtB9MwP{3Q%VC6?*g5JK$1v8MLui2j6{fp zRAdZ^gX748fMikVZV-sv&5aW5P8E=a$gcts0V;}KKny7O2$eWZBB!XR$Pc;{{eI~f zi$r{YC{n4&KZ}axY(fM{K>$I*kh}#r{04+C8G|R`H~8V#BM3M=5sM>Y@kDPtfr2Ab z@Fc{?2dU2n3KJ<2!OV}j^br-AtWd}(Sgca1#3+dvDVT)ClgVT(j({Z)y!8lgd4@#6 zS9we1>y{OQ0l5Ga$rK`~1hJ&ZPmrc7s7QUKe_lZ>`y?xoe{7S!VOSMkhQ(uWOIKP3 zayb7VDi(i2%M}s8U-kY^VR=-B48TSJa%nm!&<`$g-BKzUB?tug3Mm*Rm8LCsaZ|EX zA(bafWr(041Ug0}5lWSEj}LGThr*J`6?};RUYx8*57z}GMUk3)menJ&M`rbi#NDz&R^AO+F-r|eLpM!x61m= z%7na=S$Pj_67r2145*Ri!v=$>sDKpewr!8!EIwK6!dBj!emdQDubi_FmXYN!)M0B4oYG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b*oB#XUL%K7G*}}EYM*X9)U7_Y^*iz z?q18J)_;88ie#6IBonv?1qJt5BGnpgj^txLEC*nPy^-7DZBp-K-;Csb9|5eiPcZ7| z7R#i1w@31EAC>c7opIfEZ;@GbIwINaW_#kgZBCbIbKM%rLgempn#`+rr*T2B+Zi%1 zr$v_#$%EEq&#m$&LBFT;3ZAx3BC`^$9*OtcVtw0k*{SIbMaau-K#$R-N_k<{j;NUk?0P3{t1f&sT3$3d-)UJyKM zgDR<%x7J?-$9z3+U_lU{jibPHa!#XJBSe8!RZs$AhDNR@2WZOm)F6JS@O z(T!e>>n<}FQYTw<8}&cmGhdD`J8E37wQ6NkxpO^cRG+Qt=yX(%k7dR|-U^Qz_N-ToJwV~FHtSe{{et(ey<=7;C282002ovPDHLkV1k?SGt>Y8 diff --git a/Demo/WSProgressHUD/WSProgressBundle.bundle/success@2x.png b/Demo/WSProgressHUD/WSProgressBundle.bundle/success@2x.png old mode 100755 new mode 100644 index c33f9f38609fb07043bb6d861265f74abaac8909..6cfe8b8b0e574b42562438977c489e9afff980d2 GIT binary patch literal 1856 zcmaJ?eN;?&7@omLfQigrw*UBIb)zrOmBwSCSPIC2AP8i0K`u9dL zgXxU84mAK)MRgLIii?<}(@!brjh|%=rh#K34-6#KMv%i|TT>bY%H{tL)$2c_O}G;I z;`cv=O{#Pw0xA&`nu=-2!XP(w? z)eiqGag~ib?M)&DpV;VhaBW9X_1rc;f|iiE{AYSIZD!rZDdq@hKV|v&9E$5a+m7GuUduJwR8U22L4?!EN&ffzefSz*fy2D4 z1Vv-P^Fp7_APb{vto!itaT^27&y6cfXK9+hq3#~L(Ya1~HE3=&-nWbDShuDs8@d%~ zsoL(EdA**y*U!8sZl7v4D+%B5xV_rmec1TAuggk`+FO6QYddp+0?y$&x$QEIEX876 z&GF)qI~PB<0OuBNZZEoCuAM^P*xnkH`(t3YcX!KQZ^hdisc-98-Pydf39B}zOz1Gb zj|*C4@#xO?V-%bKUwYhj@N#yyyX%|w9j32lF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4AM-b9SDP*~b*8($gG9rP%BsBt4*9c5qBQRx+z&`+|O1WUM TGY;rE00000NkvXXu0mjfBuild Phases->Copy Bundle Resources. +Add the QuartzCore framework to your project. ##Thanks diff --git a/WSProgressHUD.podspec b/WSProgressHUD.podspec index 5ba8c84..845296b 100644 --- a/WSProgressHUD.podspec +++ b/WSProgressHUD.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "WSProgressHUD" - s.version = "1.0.5" + s.version = "1.0.6" s.summary = "WSProgressHUD is a beauful hud view for iPhone & iPad." s.description = <<-DESC @@ -34,7 +34,7 @@ Pod::Spec.new do |s| s.author = { "袁仕崇" => "xiaochong2154@163.com" } s.platform = :ios, "6.0" - s.source = { :git => "https://github.com/devSC/WSProgressHUD.git", :tag => "1.0.5" } + s.source = { :git => "https://github.com/devSC/WSProgressHUD.git", :tag => "1.0.6" } s.source_files = "WSProgressHUD/*" s.exclude_files = "Demo/Exclude" diff --git a/WSProgressHUD/MMMaterialDesignSpinner.h b/WSProgressHUD/MMMaterialDesignSpinner.h index ca8848d..6ad3ef3 100755 --- a/WSProgressHUD/MMMaterialDesignSpinner.h +++ b/WSProgressHUD/MMMaterialDesignSpinner.h @@ -33,6 +33,7 @@ FOUNDATION_EXPORT const unsigned char MMMaterialDesignSpinnerVersionString[]; /** Property indicating whether the view is currently animating. */ @property (nonatomic, readonly) BOOL isAnimating; +@property (nonatomic, strong) UIColor *spinnerColor; /** * Convenience function for starting & stopping animation with a boolean variable instead of explicit * method calls. diff --git a/WSProgressHUD/MMMaterialDesignSpinner.m b/WSProgressHUD/MMMaterialDesignSpinner.m index a5a2757..8d256d4 100755 --- a/WSProgressHUD/MMMaterialDesignSpinner.m +++ b/WSProgressHUD/MMMaterialDesignSpinner.m @@ -169,12 +169,17 @@ - (void)updatePath { - (CAShapeLayer *)progressLayer { if (!_progressLayer) { _progressLayer = [CAShapeLayer layer]; - _progressLayer.strokeColor = self.tintColor.CGColor; + _progressLayer.strokeColor = [UIColor blueColor].CGColor; _progressLayer.fillColor = nil; _progressLayer.lineWidth = 1.5f; } return _progressLayer; } +- (void)setSpinnerColor:(UIColor *)spinnerColor +{ + self.progressLayer.strokeColor = spinnerColor.CGColor; +} + - (BOOL)isAnimating { return _isAnimating; diff --git a/WSProgressHUD/WSProgressHUD.h b/WSProgressHUD/WSProgressHUD.h index befc74c..14b3979 100644 --- a/WSProgressHUD/WSProgressHUD.h +++ b/WSProgressHUD/WSProgressHUD.h @@ -23,8 +23,8 @@ typedef NS_ENUM(NSInteger, WSProgressHUDMaskWithoutType) { // }; typedef NS_ENUM(NSInteger, WSProgressHUDIndicatorStyle) { - WSProgressHUDIndicatorMMSpinner, WSProgressHUDIndicatorCustom, + WSProgressHUDIndicatorMMSpinner, WSProgressHUDIndicatorSmallLight, }; diff --git a/WSProgressHUD/WSProgressHUD.m b/WSProgressHUD/WSProgressHUD.m index a45b16a..1b12678 100644 --- a/WSProgressHUD/WSProgressHUD.m +++ b/WSProgressHUD/WSProgressHUD.m @@ -69,7 +69,7 @@ @interface WSProgressHUD () static UIImage *WSProgressHUDSuccessImage; static UIImage *WSProgressHUDErrorImage; -static CGFloat const WSProgressHUDIndicatorBig = 35; +static CGFloat const WSProgressHUDIndicatorBig = 31; static CGFloat const WSProgressHUDIndicatorSmall = 20; static CGFloat WSProgressHUDRingThickness = 2; @@ -341,10 +341,10 @@ - (void)showProgress:(CGFloat)progress status:(NSString*)string maskType:(WSProg self.ringLayer.strokeEnd = progress; return; } - objc_setAssociatedObject(self, @selector(maskType), @(maskType), OBJC_ASSOCIATION_ASSIGN); objc_setAssociatedObject(self, @selector(hudType), @(WSProgressHUDTypeProgress), OBJC_ASSOCIATION_ASSIGN); objc_setAssociatedObject(self, @selector(withoutType), @(withoutType), OBJC_ASSOCIATION_ASSIGN); + [self invalidateTimer]; [self setMaskEdgeWithType:self.maskType]; @@ -982,7 +982,7 @@ - (void)drawRect:(CGRect)rect switch (self.maskType) { case WSProgressHUDMaskTypeClear: { CGContextRef context = UIGraphicsGetCurrentContext(); - [[UIColor clearColor] set]; + [[UIColor clearColor] set]; CGRect bounds = self.bounds; CGContextFillRect(context, bounds); }break; @@ -1155,11 +1155,6 @@ - (UIImageView *)imageView if (!_imageView) { _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)]; _imageView.hidden = YES; - if ([_imageView respondsToSelector:@selector(setTintColor:)]) { - [_imageView setTintColor:WSProgressHUDForeGroundColor]; - } else { - - } } return _imageView; } @@ -1181,7 +1176,7 @@ - (MMMaterialDesignSpinner *)spinnerView if (!_spinnerView) { _spinnerView = [[MMMaterialDesignSpinner alloc] initWithFrame:CGRectZero]; _spinnerView.bounds = CGRectMake(0, 0, 20, 20); - _spinnerView.tintColor = WSProgressHUDForeGroundColor; + [_spinnerView setSpinnerColor:[UIColor whiteColor]]; } return _spinnerView; } From f0b862fe6d96c8becb478d46a1893a31ad7135db Mon Sep 17 00:00:00 2001 From: YSC Date: Wed, 12 Aug 2015 09:33:28 +0800 Subject: [PATCH 5/5] ReadMe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b74b795..8080c42 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ pod "WSProgressHUD" ## Manually Drag the WSProgressHUD/Demo/WSProgressHUD folder into your project. -Then take care that SVProgressHUD.bundle is added to Targets->Build Phases->Copy Bundle Resources. +Then take care that WSProgressHUD.bundle is added to Targets->Build Phases->Copy Bundle Resources. Add the QuartzCore framework to your project. ##Thanks