// // SIAlertView.h // SIAlertView // // Created by Kevin Cao on 13-4-29. // Copyright (c) 2013年 Sumi Interactive. All rights reserved. // #import extern NSString *const SIAlertViewWillShowNotification; extern NSString *const SIAlertViewDidShowNotification; extern NSString *const SIAlertViewWillDismissNotification; extern NSString *const SIAlertViewDidDismissNotification; typedef NS_ENUM(NSInteger, SIAlertViewButtonType) { SIAlertViewButtonTypeDefault = 0, SIAlertViewButtonTypeDestructive, SIAlertViewButtonTypeCancel }; typedef NS_ENUM(NSInteger, SIAlertViewBackgroundStyle) { SIAlertViewBackgroundStyleGradient = 0, SIAlertViewBackgroundStyleSolid, }; typedef NS_ENUM(NSInteger, SIAlertViewButtonsListStyle) { SIAlertViewButtonsListStyleNormal = 0, SIAlertViewButtonsListStyleRows }; typedef NS_ENUM(NSInteger, SIAlertViewTransitionStyle) { SIAlertViewTransitionStyleSlideFromBottom = 0, SIAlertViewTransitionStyleSlideFromTop, SIAlertViewTransitionStyleFade, SIAlertViewTransitionStyleBounce, SIAlertViewTransitionStyleDropDown }; @class SIAlertView; typedef void(^SIAlertViewHandler)(SIAlertView *alertView); @interface SIAlertView : UIView @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *message; @property (nonatomic, assign) SIAlertViewTransitionStyle transitionStyle; // default is SIAlertViewTransitionStyleSlideFromBottom @property (nonatomic, assign) SIAlertViewBackgroundStyle backgroundStyle; // default is SIAlertViewButtonTypeGradient @property (nonatomic, assign) SIAlertViewButtonsListStyle buttonsListStyle; // default is SIAlertViewButtonsListStyleNormal @property (nonatomic, copy) SIAlertViewHandler willShowHandler; @property (nonatomic, copy) SIAlertViewHandler didShowHandler; @property (nonatomic, copy) SIAlertViewHandler willDismissHandler; @property (nonatomic, copy) SIAlertViewHandler didDismissHandler; @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; @property (nonatomic, strong) UIFont *messageFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; @property (nonatomic, strong) UIFont *buttonFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; @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, 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 - (void)setDefaultButtonImage:(UIImage *)defaultButtonImage forState:(UIControlState)state NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; - (void)setCancelButtonImage:(UIImage *)cancelButtonImage forState:(UIControlState)state NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; - (void)setDestructiveButtonImage:(UIImage *)destructiveButtonImage forState:(UIControlState)state NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; - (id)initWithTitle:(NSString *)title andMessage:(NSString *)message; - (void)addButtonWithTitle:(NSString *)title type:(SIAlertViewButtonType)type handler:(SIAlertViewHandler)handler; - (void)show; - (void)dismissAnimated:(BOOL)animated; @end