Skip to content

Commit 0e1e34b

Browse files
committed
fluent: first steps
1 parent dcb689e commit 0e1e34b

2 files changed

Lines changed: 589 additions & 0 deletions

File tree

SCLAlertView/SCLAlertView.h

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,83 @@ typedef NS_ENUM(NSInteger, SCLAlertViewBackground)
445445
- (void)showQuestion:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
446446

447447
@end
448+
449+
@interface SCLAlertViewShowBuilder : NSObject
450+
451+
@property(copy, nonatomic, readonly) UIViewController *parameterViewController;
452+
@property(copy, nonatomic, readonly) UIImage *parameterImage;
453+
@property(copy, nonatomic, readonly) UIColor *parameterColor;
454+
@property(copy, nonatomic, readonly) NSString *parameterTitle;
455+
@property(copy, nonatomic, readonly) NSString *parameterSubTitle;
456+
@property(copy, nonatomic, readonly) NSString *parameterCompleteText;
457+
@property(assign, nonatomic, readonly) SCLAlertViewStyle parameterStyle;
458+
@property(copy, nonatomic, readonly) NSString *parameterCloseButtonTitle;
459+
@property(assign, nonatomic, readonly) NSTimeInterval parameterDuration;
460+
461+
#pragma mark - Setters
462+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^viewController)(UIViewController *viewController);
463+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^image)(UIImage *image);
464+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^color)(UIColor *color);
465+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^title)(NSString *title);
466+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^subTitle)(NSString *subTitle);
467+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^completeText)(NSString *completeText);
468+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^style)(SCLAlertViewStyle style);
469+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^closeButtonTitle)(NSString *closeButtonTitle);
470+
@property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^duration)(NSTimeInterval duration);
471+
472+
- (void)showAlertView:(SCLAlertView *)alertView;
473+
@end
474+
475+
@interface SCLAlertViewBuilder : NSObject
476+
477+
#pragma mark - Parameters
478+
@property (copy, nonatomic, readonly) SCLAlertView *alertView;
479+
480+
#pragma mark - Init
481+
- (instancetype)init;
482+
- (instancetype)initWithNewWindow;
483+
- (instancetype)initWithNewWindowWidth:(CGFloat)width;
484+
485+
#pragma mark - Properties
486+
@property(copy, nonatomic) SCLAlertViewBuilder *(^cornerRadius) (CGFloat cornerRadius);
487+
@property(copy, nonatomic) SCLAlertViewBuilder *(^tintTopCircle) (BOOL tintTopCircle);
488+
@property(copy, nonatomic) SCLAlertViewBuilder *(^useLargerIcon) (BOOL useLargerIcon);
489+
@property(copy, nonatomic) SCLAlertViewBuilder *(^labelTitle) (UILabel *labelTitle);
490+
@property(copy, nonatomic) SCLAlertViewBuilder *(^viewText) (UITextView *viewText);
491+
@property(copy, nonatomic) SCLAlertViewBuilder *(^activityIndicatorView) (UIActivityIndicatorView *activityIndicatorView);
492+
@property(copy, nonatomic) SCLAlertViewBuilder *(^shouldDismissOnTapOutside) (BOOL shouldDismissOnTapOutside);
493+
@property(copy, nonatomic) SCLAlertViewBuilder *(^soundURL) (NSURL *soundURL);
494+
@property(copy, nonatomic) SCLAlertViewBuilder *(^attributedFormatBlock) (SCLAttributedFormatBlock attributedFormatBlock);
495+
@property(copy, nonatomic) SCLAlertViewBuilder *(^completeButtonFormatBlock) (CompleteButtonFormatBlock completeButtonFormatBlock);
496+
@property(copy, nonatomic) SCLAlertViewBuilder *(^buttonFormatBlock) (ButtonFormatBlock buttonFormatBlock);
497+
@property(copy, nonatomic) SCLAlertViewBuilder *(^forceHideBlock) (SCLForceHideBlock forceHideBlock);
498+
@property(copy, nonatomic) SCLAlertViewBuilder *(^hideAnimationType) (SCLAlertViewHideAnimation hideAnimationType);
499+
@property(copy, nonatomic) SCLAlertViewBuilder *(^showAnimationType) (SCLAlertViewShowAnimation showAnimationType);
500+
@property(copy, nonatomic) SCLAlertViewBuilder *(^backgroundType) (SCLAlertViewBackground backgroundType);
501+
@property(copy, nonatomic) SCLAlertViewBuilder *(^customViewColor) (UIColor *customViewColor);
502+
@property(copy, nonatomic) SCLAlertViewBuilder *(^backgroundViewColor) (UIColor *backgroundViewColor);
503+
@property(copy, nonatomic) SCLAlertViewBuilder *(^iconTintColor) (UIColor *iconTintColor);
504+
@property(copy, nonatomic) SCLAlertViewBuilder *(^circleIconHeight) (CGFloat circleIconHeight);
505+
@property(copy, nonatomic) SCLAlertViewBuilder *(^extensionBounds) (CGRect extensionBounds);
506+
@property(copy, nonatomic) SCLAlertViewBuilder *(^statusBarHidden) (BOOL statusBarHidden);
507+
@property(copy, nonatomic) SCLAlertViewBuilder *(^statusBarStyle) (UIStatusBarStyle statusBarStyle);
508+
509+
#pragma mark - Custom Setters
510+
@property(copy, nonatomic) SCLAlertViewBuilder *(^alertIsDismissed) (SCLDismissBlock dismissBlock);
511+
@property(copy, nonatomic) SCLAlertViewBuilder *(^removeTopCircle)(void);
512+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addCustomView)(UIView *view);
513+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addTextField)(NSString *title);
514+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addCustomTextField)(UITextField *textField);
515+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addSwitchViewWithLabelTitle)(NSString *title);
516+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addTimerToButtonIndex)(NSInteger buttonIndex, BOOL reverse);
517+
@property(copy, nonatomic) SCLAlertViewBuilder *(^setTitleFontFamily)(NSString *titleFontFamily, CGFloat size);
518+
@property(copy, nonatomic) SCLAlertViewBuilder *(^setBodyTextFontFamily)(NSString *bodyTextFontFamily, CGFloat size);
519+
@property(copy, nonatomic) SCLAlertViewBuilder *(^setButtonsTextFontFamily)(NSString *buttonsFontFamily, CGFloat size);
520+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addButtonWithActionBlock)(NSString *title, SCLActionBlock action);
521+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addButtonWithValidationBlock)(NSString *title, SCLValidationBlock validationBlock, SCLActionBlock action);
522+
@property(copy, nonatomic) SCLAlertViewBuilder *(^addButtonWithTarget)(NSString *title, id target, SEL selector);
523+
524+
#pragma mark - Show Builder
525+
@property(copy, nonatomic) SCLAlertViewBuilder *(^showBuilder)(void(^showBuilder)(SCLAlertViewShowBuilder *builder));
526+
527+
@end

0 commit comments

Comments
 (0)