Skip to content

Commit 6965aad

Browse files
author
YSC
committed
Merge branch 'master' of https://github.com/devSC/WSProgressHUD
2 parents 556f184 + d902d11 commit 6965aad

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

Demo/WSProgressHUD/WSProgressHUD.m

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,13 +1043,8 @@ - (instancetype)initWithFrame:(CGRect)frame
10431043
UIImage *successImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"success@2x" ofType:@"png"]];
10441044
UIImage *failurImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"error@2x" ofType:@"png"]];
10451045

1046-
if ([[UIImage class] instancesRespondToSelector:@selector(imageWithRenderingMode:)]) {
1047-
WSProgressHUDSuccessImage = [successImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
1048-
WSProgressHUDErrorImage = [failurImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
1049-
} else {
1050-
WSProgressHUDErrorImage = failurImage;
1051-
WSProgressHUDSuccessImage = successImage;
1052-
}
1046+
WSProgressHUDSuccessImage = [self image:successImage withTintColor:WSProgressHUDForeGroundColor];
1047+
WSProgressHUDErrorImage = [self image:failurImage withTintColor:WSProgressHUDForeGroundColor];
10531048

10541049
[self addSubview:self.hudView];
10551050

@@ -1104,7 +1099,7 @@ - (UILabel *)labelView
11041099
}
11051100
_labelView.adjustsFontSizeToFitWidth = YES;
11061101
_labelView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
1107-
_labelView.textAlignment = NSTextAlignmentLeft;
1102+
_labelView.textAlignment = NSTextAlignmentCenter;
11081103
_labelView.numberOfLines = 0;
11091104
}
11101105
return _labelView;

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ To Download the project. Run the WSProgressHUD.xcodeproj in the demo directory.
8181
```
8282
## Installation
8383
84+
8485
WSProgressHUD is available through [CocoaPods](http://cocoapods.org). To install
8586
it, simply add the following line to your Podfile:
8687

WSProgressHUD/WSProgressHUD.m

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,13 +1043,8 @@ - (instancetype)initWithFrame:(CGRect)frame
10431043
UIImage *successImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"success@2x" ofType:@"png"]];
10441044
UIImage *failurImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"error@2x" ofType:@"png"]];
10451045

1046-
if ([[UIImage class] instancesRespondToSelector:@selector(imageWithRenderingMode:)]) {
1047-
WSProgressHUDSuccessImage = [successImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
1048-
WSProgressHUDErrorImage = [failurImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
1049-
} else {
1050-
WSProgressHUDErrorImage = failurImage;
1051-
WSProgressHUDSuccessImage = successImage;
1052-
}
1046+
WSProgressHUDSuccessImage = [self image:successImage withTintColor:WSProgressHUDForeGroundColor];
1047+
WSProgressHUDErrorImage = [self image:failurImage withTintColor:WSProgressHUDForeGroundColor];
10531048

10541049
[self addSubview:self.hudView];
10551050

@@ -1104,7 +1099,7 @@ - (UILabel *)labelView
11041099
}
11051100
_labelView.adjustsFontSizeToFitWidth = YES;
11061101
_labelView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
1107-
_labelView.textAlignment = NSTextAlignmentLeft;
1102+
_labelView.textAlignment = NSTextAlignmentCenter;
11081103
_labelView.numberOfLines = 0;
11091104
}
11101105
return _labelView;

0 commit comments

Comments
 (0)