Customizable implementation of UIAlertViewController, UIAlertView and UIActionSheet. All in one. You can customize every detail. Make AlertView of your dream! :)
progressLabelText
for alertView
with activityIndicator
as well as for alertView
with progressView
:alertView.progressLabelText = @"Some text"
@property
:alertView.progress = 50.0;
# Delegates
- (void)showAnimationsForAlertView:(nonnull LGAlertView *)alertView duration:(NSTimeInterval)duration;
- (void)dismissAnimationsForAlertView:(nonnull LGAlertView *)alertView duration:(NSTimeInterval)duration;
# Blocks
void(^ _Nullable showAnimationsBlock)(LGAlertView * _Nonnull alertView, NSTimeInterval duration);
void(^ _Nullable dismissAnimationsBlock)(LGAlertView * _Nonnull alertView, NSTimeInterval duration);
# Notifications
LGAlertViewShowAnimationsNotification;
LGAlertViewDismissAnimationsNotification;
Fix bugs with status bar and keyboard
delegate
protocol:// BEFORE
- (void)alertView:(nonnull LGAlertView *)alertView buttonPressedWithTitle:(nullable NSString *)title index:(NSUInteger)index;
- (void)alertViewDestructiveButtonPressed:(nonnull LGAlertView *)alertView;
// NOW
- (void)alertView:(nonnull LGAlertView *)alertView clickedButtonAtIndex:(NSUInteger)index title:(nullable NSString *)title;
- (void)alertViewDestructed:(nonnull LGAlertView *)alertView;
// Notifications
extern NSString *_Nonnull const LGAlertViewDidDismissAfterActionNotification;
extern NSString *_Nonnull const LGAlertViewDidDismissAfterCancelNotification;
extern NSString *_Nonnull const LGAlertViewDidDismissAfterDestructiveNotification;
// Callbacks
@property (copy, nonatomic) LGAlertViewActionHandler didDismissAfterActionHandler;
@property (copy, nonatomic) LGAlertViewHandler didDismissAfterCancelHandler;
@property (copy, nonatomic) LGAlertViewHandler didDismissAfterDestructiveHandler;
// Delegate methods
- (void)alertView:(nonnull LGAlertView *)alertView didDismissAfterClickedButtonAtIndex:(NSUInteger)index title:(nullable NSString *)title;
- (void)alertViewDidDismissAfterCancelled:(nonnull LGAlertView *)alertView;
- (void)alertViewDidDismissAfterDestructed:(nonnull LGAlertView *)alertView;
/** Default is YES */
@property (assign, nonatomic) BOOL shouldDismissAnimated UI_APPEARANCE_SELECTOR;
+ (NSArray *)getAlertViewsArray;
/** Default is [UIColor colorWithWhite:0.97 alpha:1.0] */
@property (strong, nonatomic, nullable) UIColor *textFieldsBackgroundColor UI_APPEARANCE_SELECTOR;
/** Default is UIColor.blackColor */
@property (strong, nonatomic, nullable) UIColor *textFieldsTextColor UI_APPEARANCE_SELECTOR;
/** Default is [UIFont systemFontOfSize:16.0] */
@property (strong, nonatomic, nullable) UIFont *textFieldsFont UI_APPEARANCE_SELECTOR;
/** Default is NSTextAlignmentLeft */
@property (assign, nonatomic) NSTextAlignment textFieldsTextAlignment UI_APPEARANCE_SELECTOR;
/** Default is NO */
@property (assign, nonatomic) BOOL textFieldsClearsOnBeginEditing UI_APPEARANCE_SELECTOR;
/** Default is NO */
@property (assign, nonatomic) BOOL textFieldsAdjustsFontSizeToFitWidth UI_APPEARANCE_SELECTOR;
/** Default is 12.0 */
@property (assign, nonatomic) CGFloat textFieldsMinimumFontSize UI_APPEARANCE_SELECTOR;
/** Default is UITextFieldViewModeAlways */
@property (assign, nonatomic) UITextFieldViewMode textFieldsClearButtonMode UI_APPEARANCE_SELECTOR;
class
methods to set global properties, you need to use appearance
:# BEFORE
LGAlertView.tintColor = [UIColor greenColor];
# NOW
[LGAlertView appearance].tintColor = UIColor.greenColor;
Fix bugs
LGAlertViewFramework
-> LGAlertView
. You need to re-add framework file.nullable
and nonnull
objects.LGAlertViewWillShowNotification
LGAlertViewDidShowNotification
LGAlertViewWillDismissNotification
LGAlertViewDidDismissNotification
LGAlertViewActionNotification
LGAlertViewCancelNotification
LGAlertViewDestructiveNotification
- (void)showAnimated;
- (void)show;
- (void)dismissAnimated;
- (void)dismiss;
- (void)transitionToAlertView:(nonnull LGAlertView *)alertView;
// Deprecated
- (void)setButtonAtIndex:(NSUInteger)index enabled:(BOOL)enabled;
// New
- (void)setButtonEnabled:(BOOL)enabled atIndex:(NSUInteger)index;
@property (copy, nonatomic, nullable) NSArray *buttonsIconImages;
@property (copy, nonatomic, nullable) NSArray *buttonsIconImagesHighlighted;
@property (copy, nonatomic, nullable) NSArray *buttonsIconImagesDisabled;
@property (assign, nonatomic) LGAlertViewButtonIconPosition buttonsIconPosition;
@property (strong, nonatomic, nullable) UIImage *cancelButtonIconImage;
@property (strong, nonatomic, nullable) UIImage *cancelButtonIconImageHighlighted;
@property (strong, nonatomic, nullable) UIImage *cancelButtonIconImageDisabled;
@property (assign, nonatomic) LGAlertViewButtonIconPosition cancelButtonIconPosition;
@property (strong, nonatomic, nullable) UIImage *destructiveButtonIconImage;
@property (strong, nonatomic, nullable) UIImage *destructiveButtonIconImageHighlighted;
@property (strong, nonatomic, nullable) UIImage *destructiveButtonIconImageDisabled;
@property (assign, nonatomic) LGAlertViewButtonIconPosition destructiveButtonIconPosition;
// Before
[LGAlertView setTintColor:UIColor.greenColor];
// Now
LGAlertView.tintColor = UIColor.greenColor;
Fixed bugs
Now you can:
alertView.dismissOnAction = NO;
[LGAlertView setTintColor:[UIColor greenColor]];
[LGAlertView setColorful:NO];
[LGAlertView setCoverColor:[UIColor colorWithWhite:1.f alpha:0.8]];
[LGAlertView setBackgroundColor:[UIColor grayColor]];
Fixed bugs