Skip to content

Commit 10e5e73

Browse files
committed
Merge branch 'develop' into ios5
2 parents ff42f0c + 47422a6 commit 10e5e73

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

SIAlertView/SIAlertView.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ typedef void(^SIAlertViewHandler)(SIAlertView *alertView);
5050

5151
@property (nonatomic, readonly, getter = isVisible) BOOL visible;
5252

53+
@property (nonatomic, strong) UIColor *viewBackgroundColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
5354
@property (nonatomic, strong) UIColor *titleColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
5455
@property (nonatomic, strong) UIColor *messageColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
5556
@property (nonatomic, strong) UIFont *titleFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;

SIAlertView/SIAlertView.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ + (void)initialize
172172
return;
173173

174174
SIAlertView *appearance = [self appearance];
175+
appearance.viewBackgroundColor = [UIColor whiteColor];
175176
appearance.titleColor = [UIColor blackColor];
176177
appearance.messageColor = [UIColor darkGrayColor];
177178
appearance.titleFont = [UIFont boldSystemFontOfSize:20];
@@ -577,7 +578,8 @@ - (void)transitionOutCompletion:(void(^)(void))completion
577578
options:UIViewAnimationOptionCurveEaseIn
578579
animations:^{
579580
self.containerView.center = point;
580-
self.containerView.transform = CGAffineTransformMakeRotation(0.3);
581+
CGFloat angle = ((CGFloat)arc4random_uniform(100) - 50.f) / 100.f;
582+
self.containerView.transform = CGAffineTransformMakeRotation(angle);
581583
}
582584
completion:^(BOOL finished) {
583585
if (completion) {
@@ -891,6 +893,15 @@ - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
891893

892894
#pragma mark - UIAppearance setters
893895

896+
- (void)setViewBackgroundColor:(UIColor *)viewBackgroundColor
897+
{
898+
if (_viewBackgroundColor == viewBackgroundColor) {
899+
return;
900+
}
901+
_viewBackgroundColor = viewBackgroundColor;
902+
self.containerView.backgroundColor = viewBackgroundColor;
903+
}
904+
894905
- (void)setTitleFont:(UIFont *)titleFont
895906
{
896907
if (_titleFont == titleFont) {

SIAlertViewExample/SIAlertViewExample/ViewController.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#import "ViewController.h"
1010
#import "SIAlertView.h"
1111

12+
#define TEST_UIAPPEARANCE 0
13+
1214
@interface ViewController ()
1315

1416
@end
@@ -18,12 +20,14 @@ @implementation ViewController
1820
- (void)viewDidLoad
1921
{
2022
[super viewDidLoad];
21-
23+
#if TEST_UIAPPEARANCE
2224
[[SIAlertView appearance] setMessageFont:[UIFont systemFontOfSize:13]];
2325
[[SIAlertView appearance] setTitleColor:[UIColor greenColor]];
2426
[[SIAlertView appearance] setMessageColor:[UIColor purpleColor]];
2527
[[SIAlertView appearance] setCornerRadius:12];
2628
[[SIAlertView appearance] setShadowRadius:20];
29+
[[SIAlertView appearance] setViewBackgroundColor:[UIColor colorWithRed:0.891 green:0.936 blue:0.978 alpha:1.000]];
30+
#endif
2731
}
2832

2933
#pragma mark - Actions

0 commit comments

Comments
 (0)