Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion SIAlertView/SIAlertView.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ extern NSString *const SIAlertViewDidDismissNotification;
typedef NS_ENUM(NSInteger, SIAlertViewButtonType) {
SIAlertViewButtonTypeDefault = 0,
SIAlertViewButtonTypeDestructive,
SIAlertViewButtonTypeCancel
SIAlertViewButtonTypeCancel,
SIAlertViewButtonTypeValid
};

typedef NS_ENUM(NSInteger, SIAlertViewBackgroundStyle) {
Expand Down Expand Up @@ -67,6 +68,7 @@ typedef void(^SIAlertViewHandler)(SIAlertView *alertView);
@property (nonatomic, strong) UIColor *buttonColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *cancelButtonColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *destructiveButtonColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *validButtonColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat cornerRadius NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; // default is 2.0
@property (nonatomic, assign) CGFloat shadowRadius NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; // default is 8.0

Expand Down
7 changes: 7 additions & 0 deletions SIAlertView/SIAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ + (void)initialize
appearance.buttonColor = [UIColor colorWithWhite:0.4 alpha:1];
appearance.cancelButtonColor = [UIColor colorWithWhite:0.3 alpha:1];
appearance.destructiveButtonColor = [UIColor whiteColor];
appearance.validButtonColor = [UIColor whiteColor];
appearance.cornerRadius = 2;
appearance.shadowRadius = 8;
}
Expand Down Expand Up @@ -988,6 +989,12 @@ - (UIButton *)buttonForItemIndex:(NSUInteger)index
[button setTitleColor:self.destructiveButtonColor forState:UIControlStateNormal];
[button setTitleColor:[self.destructiveButtonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted];
break;
case SIAlertViewButtonTypeValid:
normalImage = [UIImage imageNamed:@"SIAlertView.bundle/button-valid-normal"];
highlightedImage = [UIImage imageNamed:@"SIAlertView.bundle/button-valid-hi"];
[button setTitleColor:self.validButtonColor forState:UIControlStateNormal];
[button setTitleColor:[self.validButtonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted];
break;
case SIAlertViewButtonTypeDefault:
default:
normalImage = [UIImage imageNamed:@"SIAlertView.bundle/button-default"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
<string>SIAlertViewExample</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>1EE19127-7F15-4095-A45D-7D481FB08953</key>
<key>E2E339EC05FF99AF5ECAE62EDBC78398DA1111C6</key>
<string>https://github.com/Sumi-Interactive/SIAlertView.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>SIAlertViewExample/SIAlertViewExample.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>1EE19127-7F15-4095-A45D-7D481FB08953</key>
<key>E2E339EC05FF99AF5ECAE62EDBC78398DA1111C6</key>
<string>../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/Sumi-Interactive/SIAlertView.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>1EE19127-7F15-4095-A45D-7D481FB08953</string>
<string>E2E339EC05FF99AF5ECAE62EDBC78398DA1111C6</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>1EE19127-7F15-4095-A45D-7D481FB08953</string>
<string>E2E339EC05FF99AF5ECAE62EDBC78398DA1111C6</string>
<key>IDESourceControlWCCName</key>
<string>SIAlertView</string>
</dict>
Expand Down
5 changes: 5 additions & 0 deletions SIAlertViewExample/SIAlertViewExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ - (IBAction)alert1:(id)sender
handler:^(SIAlertView *alertView) {
NSLog(@"Button3 Clicked");
}];
[alertView addButtonWithTitle:@"Button4"
type:SIAlertViewButtonTypeValid
handler:^(SIAlertView *alertView) {
NSLog(@"Button4 Clicked");
}];

alertView.willShowHandler = ^(SIAlertView *alertView) {
NSLog(@"%@, willShowHandler", alertView);
Expand Down