Skip to content

Commit

Permalink
Fixed bugs, updated to NS_ENUM, added ability to set parameters for e…
Browse files Browse the repository at this point in the history
…very button
  • Loading branch information
Friend-LGA committed Nov 9, 2015
1 parent 6f6c270 commit 2a0a093
Show file tree
Hide file tree
Showing 8 changed files with 969 additions and 246 deletions.
344 changes: 308 additions & 36 deletions Demo/LGAlertViewDemo/TableViewControllerActionSheet.m

Large diffs are not rendered by default.

339 changes: 262 additions & 77 deletions Demo/LGAlertViewDemo/TableViewControllerAlert.m

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Demo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- LGAlertView (2.0.2)
- LGAlertView (2.0.4)

DEPENDENCIES:
- LGAlertView (from `../`)
Expand All @@ -9,6 +9,6 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
LGAlertView: 044299d2a66674a13c04d397555ffc5e4a666831
LGAlertView: bd8c89da95f31a9bdeda279d9939629cbcbfaaca

COCOAPODS: 0.39.0
2 changes: 1 addition & 1 deletion LGAlertView.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'LGAlertView'
s.version = '2.0.3'
s.version = '2.0.4'
s.platform = :ios, '6.0'
s.license = 'MIT'
s.homepage = 'https://github.com/Friend-LGA/LGAlertView'
Expand Down
21 changes: 15 additions & 6 deletions LGAlertView/LGAlertView.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
//

#import <UIKit/UIKit.h>
#import "LGAlertViewButtonProperties.h"

@class LGAlertView;

Expand Down Expand Up @@ -55,19 +56,17 @@ static NSString *const kLGAlertViewDestructiveNotification = @"LGAlertViewDestru

@interface LGAlertView : NSObject

typedef enum
typedef NS_ENUM(NSUInteger, LGAlertViewStyle)
{
LGAlertViewStyleAlert = 0,
LGAlertViewStyleActionSheet = 1
}
LGAlertViewStyle;
};

typedef enum
typedef NS_ENUM(NSUInteger, LGAlertViewWindowLevel)
{
LGAlertViewWindowLevelAboveStatusBar = 0,
LGAlertViewWindowLevelBelowStatusBar = 1
}
LGAlertViewWindowLevel;
};

@property (assign, nonatomic, getter=isShowing) BOOL showing;
/** Default is LGAlertViewWindowLevelAboveStatusBar */
Expand Down Expand Up @@ -119,28 +118,35 @@ LGAlertViewWindowLevel;
@property (assign, nonatomic) NSLineBreakMode buttonsLineBreakMode;
@property (assign, nonatomic) CGFloat buttonsMinimumScaleFactor;
@property (assign, nonatomic, getter=isButtonsAdjustsFontSizeToFitWidth) BOOL buttonsAdjustsFontSizeToFitWidth;
@property (assign, nonatomic, getter=isCancelButtonEnabled) BOOL buttonsEnabled;

@property (strong, nonatomic) UIColor *cancelButtonTitleColor;
@property (strong, nonatomic) UIColor *cancelButtonTitleColorHighlighted;
@property (strong, nonatomic) UIColor *cancelButtonTitleColorDisabled;
@property (assign, nonatomic) NSTextAlignment cancelButtonTextAlignment;
@property (strong, nonatomic) UIFont *cancelButtonFont;
@property (strong, nonatomic) UIColor *cancelButtonBackgroundColor;
@property (strong, nonatomic) UIColor *cancelButtonBackgroundColorHighlighted;
@property (strong, nonatomic) UIColor *cancelButtonBackgroundColorDisabled;
@property (assign, nonatomic) NSUInteger cancelButtonNumberOfLines;
@property (assign, nonatomic) NSLineBreakMode cancelButtonLineBreakMode;
@property (assign, nonatomic) CGFloat cancelButtonMinimumScaleFactor;
@property (assign, nonatomic, getter=isCancelButtonAdjustsFontSizeToFitWidth) BOOL cancelButtonAdjustsFontSizeToFitWidth;
@property (assign, nonatomic, getter=isCancelButtonEnabled) BOOL cancelButtonEnabled;

@property (strong, nonatomic) UIColor *destructiveButtonTitleColor;
@property (strong, nonatomic) UIColor *destructiveButtonTitleColorHighlighted;
@property (strong, nonatomic) UIColor *destructiveButtonTitleColorDisabled;
@property (assign, nonatomic) NSTextAlignment destructiveButtonTextAlignment;
@property (strong, nonatomic) UIFont *destructiveButtonFont;
@property (strong, nonatomic) UIColor *destructiveButtonBackgroundColor;
@property (strong, nonatomic) UIColor *destructiveButtonBackgroundColorHighlighted;
@property (strong, nonatomic) UIColor *destructiveButtonBackgroundColorDisabled;
@property (assign, nonatomic) NSUInteger destructiveButtonNumberOfLines;
@property (assign, nonatomic) NSLineBreakMode destructiveButtonLineBreakMode;
@property (assign, nonatomic) CGFloat destructiveButtonMinimumScaleFactor;
@property (assign, nonatomic, getter=isDestructiveButtonAdjustsFontSizeToFitWidth) BOOL destructiveButtonAdjustsFontSizeToFitWidth;
@property (assign, nonatomic, getter=isDestructiveButtonEnabled) BOOL destructiveButtonEnabled;

@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
@property (strong, nonatomic) UIColor *activityIndicatorViewColor;
Expand Down Expand Up @@ -477,6 +483,8 @@ LGAlertViewWindowLevel;

- (void)setProgress:(float)progress progressLabelText:(NSString *)progressLabelText;

- (void)setButtonPropertiesAtIndex:(NSUInteger)index handler:(void(^)(LGAlertViewButtonProperties *properties))handler;

- (void)setButtonAtIndex:(NSUInteger)index enabled:(BOOL)enabled;
- (BOOL)isButtonEnabledAtIndex:(NSUInteger)index;

Expand All @@ -487,6 +495,7 @@ LGAlertViewWindowLevel;
- (void)forceActionAtIndex:(NSUInteger)index;

+ (void)setTintColor:(UIColor *)color;
+ (void)setColorful:(BOOL)colorful;

#pragma mark -

Expand Down
Loading

0 comments on commit 2a0a093

Please sign in to comment.