Skip to content

Commit

Permalink
Merge branch 'develop' into ios5
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoji2 committed Jun 10, 2013
2 parents ff42f0c + 47422a6 commit 10e5e73
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions SIAlertView/SIAlertView.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef void(^SIAlertViewHandler)(SIAlertView *alertView);

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

@property (nonatomic, strong) UIColor *viewBackgroundColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *titleColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *messageColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIFont *titleFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
Expand Down
13 changes: 12 additions & 1 deletion SIAlertView/SIAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ + (void)initialize
return;

SIAlertView *appearance = [self appearance];
appearance.viewBackgroundColor = [UIColor whiteColor];
appearance.titleColor = [UIColor blackColor];
appearance.messageColor = [UIColor darkGrayColor];
appearance.titleFont = [UIFont boldSystemFontOfSize:20];
Expand Down Expand Up @@ -577,7 +578,8 @@ - (void)transitionOutCompletion:(void(^)(void))completion
options:UIViewAnimationOptionCurveEaseIn
animations:^{
self.containerView.center = point;
self.containerView.transform = CGAffineTransformMakeRotation(0.3);
CGFloat angle = ((CGFloat)arc4random_uniform(100) - 50.f) / 100.f;
self.containerView.transform = CGAffineTransformMakeRotation(angle);
}
completion:^(BOOL finished) {
if (completion) {
Expand Down Expand Up @@ -891,6 +893,15 @@ - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag

#pragma mark - UIAppearance setters

- (void)setViewBackgroundColor:(UIColor *)viewBackgroundColor
{
if (_viewBackgroundColor == viewBackgroundColor) {
return;
}
_viewBackgroundColor = viewBackgroundColor;
self.containerView.backgroundColor = viewBackgroundColor;
}

- (void)setTitleFont:(UIFont *)titleFont
{
if (_titleFont == titleFont) {
Expand Down
6 changes: 5 additions & 1 deletion SIAlertViewExample/SIAlertViewExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import "ViewController.h"
#import "SIAlertView.h"

#define TEST_UIAPPEARANCE 0

@interface ViewController ()

@end
Expand All @@ -18,12 +20,14 @@ @implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
#if TEST_UIAPPEARANCE
[[SIAlertView appearance] setMessageFont:[UIFont systemFontOfSize:13]];
[[SIAlertView appearance] setTitleColor:[UIColor greenColor]];
[[SIAlertView appearance] setMessageColor:[UIColor purpleColor]];
[[SIAlertView appearance] setCornerRadius:12];
[[SIAlertView appearance] setShadowRadius:20];
[[SIAlertView appearance] setViewBackgroundColor:[UIColor colorWithRed:0.891 green:0.936 blue:0.978 alpha:1.000]];
#endif
}

#pragma mark - Actions
Expand Down

0 comments on commit 10e5e73

Please sign in to comment.