SCLAlertView.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. //
  2. // SCLAlertView.h
  3. // SCLAlertView
  4. //
  5. // Created by Diogo Autilio on 9/26/14.
  6. // Copyright (c) 2014-2017 AnyKey Entertainment. All rights reserved.
  7. //
  8. #if defined(__has_feature) && __has_feature(modules)
  9. @import UIKit;
  10. #else
  11. #import <UIKit/UIKit.h>
  12. #endif
  13. #import "SCLButton.h"
  14. #import "SCLTextView.h"
  15. #import "SCLSwitchView.h"
  16. typedef NSAttributedString* (^SCLAttributedFormatBlock)(NSString *value);
  17. typedef void (^SCLDismissBlock)(void);
  18. typedef void (^SCLDismissAnimationCompletionBlock)(void);
  19. typedef void (^SCLShowAnimationCompletionBlock)(void);
  20. typedef void (^SCLForceHideBlock)(void);
  21. @interface SCLAlertView : UIViewController
  22. /** Alert Styles
  23. *
  24. * Set SCLAlertView Style
  25. */
  26. typedef NS_ENUM(NSInteger, SCLAlertViewStyle)
  27. {
  28. SCLAlertViewStyleSuccess,
  29. SCLAlertViewStyleError,
  30. SCLAlertViewStyleNotice,
  31. SCLAlertViewStyleWarning,
  32. SCLAlertViewStyleInfo,
  33. SCLAlertViewStyleEdit,
  34. SCLAlertViewStyleWaiting,
  35. SCLAlertViewStyleQuestion,
  36. SCLAlertViewStyleCustom
  37. };
  38. /** Alert hide animation styles
  39. *
  40. * Set SCLAlertView hide animation type.
  41. */
  42. typedef NS_ENUM(NSInteger, SCLAlertViewHideAnimation)
  43. {
  44. SCLAlertViewHideAnimationFadeOut,
  45. SCLAlertViewHideAnimationSlideOutToBottom,
  46. SCLAlertViewHideAnimationSlideOutToTop,
  47. SCLAlertViewHideAnimationSlideOutToLeft,
  48. SCLAlertViewHideAnimationSlideOutToRight,
  49. SCLAlertViewHideAnimationSlideOutToCenter,
  50. SCLAlertViewHideAnimationSlideOutFromCenter,
  51. SCLAlertViewHideAnimationSimplyDisappear
  52. };
  53. /** Alert show animation styles
  54. *
  55. * Set SCLAlertView show animation type.
  56. */
  57. typedef NS_ENUM(NSInteger, SCLAlertViewShowAnimation)
  58. {
  59. SCLAlertViewShowAnimationFadeIn,
  60. SCLAlertViewShowAnimationSlideInFromBottom,
  61. SCLAlertViewShowAnimationSlideInFromTop,
  62. SCLAlertViewShowAnimationSlideInFromLeft,
  63. SCLAlertViewShowAnimationSlideInFromRight,
  64. SCLAlertViewShowAnimationSlideInFromCenter,
  65. SCLAlertViewShowAnimationSlideInToCenter,
  66. SCLAlertViewShowAnimationSimplyAppear
  67. };
  68. /** Alert background styles
  69. *
  70. * Set SCLAlertView background type.
  71. */
  72. typedef NS_ENUM(NSInteger, SCLAlertViewBackground)
  73. {
  74. SCLAlertViewBackgroundShadow,
  75. SCLAlertViewBackgroundBlur,
  76. SCLAlertViewBackgroundTransparent
  77. };
  78. /** Content view corner radius
  79. *
  80. * A float value that replaces the standard content viuew corner radius.
  81. */
  82. @property CGFloat cornerRadius;
  83. /** Tint top circle
  84. *
  85. * A boolean value that determines whether to tint the SCLAlertView top circle.
  86. * (Default: YES)
  87. */
  88. @property (assign, nonatomic) BOOL tintTopCircle;
  89. /** Use larger icon
  90. *
  91. * A boolean value that determines whether to make the SCLAlertView top circle icon larger.
  92. * (Default: NO)
  93. */
  94. @property (assign, nonatomic) BOOL useLargerIcon;
  95. /** Title Label
  96. *
  97. * The text displayed as title.
  98. */
  99. @property (strong, nonatomic) UILabel *labelTitle;
  100. /** Text view with the body message
  101. *
  102. * Holds the textview.
  103. */
  104. @property (strong, nonatomic) UITextView *viewText;
  105. /** Activity Indicator
  106. *
  107. * Holds the activityIndicator.
  108. */
  109. @property (strong, nonatomic) UIActivityIndicatorView *activityIndicatorView;
  110. /** Dismiss on tap outside
  111. *
  112. * A boolean value that determines whether to dismiss when tapping outside the SCLAlertView.
  113. * (Default: NO)
  114. */
  115. @property (assign, nonatomic) BOOL shouldDismissOnTapOutside;
  116. /** Sound URL
  117. *
  118. * Holds the sound NSURL path.
  119. */
  120. @property (strong, nonatomic) NSURL *soundURL;
  121. /** Set text attributed format block
  122. *
  123. * Holds the attributed string.
  124. */
  125. @property (copy, nonatomic) SCLAttributedFormatBlock attributedFormatBlock;
  126. /** Set Complete button format block.
  127. *
  128. * Holds the button format block.
  129. * Support keys : backgroundColor, borderWidth, borderColor, textColor
  130. */
  131. @property (copy, nonatomic) CompleteButtonFormatBlock completeButtonFormatBlock;
  132. /** Set button format block.
  133. *
  134. * Holds the button format block.
  135. * Support keys : backgroundColor, borderWidth, borderColor, textColor
  136. */
  137. @property (copy, nonatomic) ButtonFormatBlock buttonFormatBlock;
  138. /** Set force hide block.
  139. *
  140. * When set force hideview method invocation.
  141. */
  142. @property (copy, nonatomic) SCLForceHideBlock forceHideBlock;
  143. /** Hide animation type
  144. *
  145. * Holds the hide animation type.
  146. * (Default: FadeOut)
  147. */
  148. @property (nonatomic) SCLAlertViewHideAnimation hideAnimationType;
  149. /** Show animation type
  150. *
  151. * Holds the show animation type.
  152. * (Default: SlideInFromTop)
  153. */
  154. @property (nonatomic) SCLAlertViewShowAnimation showAnimationType;
  155. /** Set SCLAlertView background type.
  156. *
  157. * SCLAlertView background type.
  158. * (Default: Shadow)
  159. */
  160. @property (nonatomic) SCLAlertViewBackground backgroundType;
  161. /** Set custom color to SCLAlertView.
  162. *
  163. * SCLAlertView custom color.
  164. * (Buttons, top circle and borders)
  165. */
  166. @property (strong, nonatomic) UIColor *customViewColor;
  167. /** Set custom color to SCLAlertView background.
  168. *
  169. * SCLAlertView background custom color.
  170. */
  171. @property (strong, nonatomic) UIColor *backgroundViewColor;
  172. /** Set custom tint color for icon image.
  173. *
  174. * SCLAlertView icon tint color
  175. */
  176. @property (strong, nonatomic) UIColor *iconTintColor;
  177. /** Set custom circle icon height.
  178. *
  179. * Circle icon height
  180. */
  181. @property (nonatomic) CGFloat circleIconHeight;
  182. /** Set SCLAlertView extension bounds.
  183. *
  184. * Set new bounds (EXTENSION ONLY)
  185. */
  186. @property (nonatomic) CGRect extensionBounds;
  187. /** Set status bar hidden.
  188. *
  189. * Status bar hidden
  190. */
  191. @property (nonatomic) BOOL statusBarHidden;
  192. /** Set status bar style.
  193. *
  194. * Status bar style
  195. */
  196. @property (nonatomic) UIStatusBarStyle statusBarStyle;
  197. /** Set horizontal alignment for buttons
  198. *
  199. * Horizontal aligment instead of vertically if YES
  200. */
  201. @property (nonatomic) BOOL horizontalButtons;
  202. /** Initialize SCLAlertView using a new window.
  203. *
  204. * Init with new window
  205. */
  206. - (instancetype)initWithNewWindow;
  207. /** Initialize SCLAlertView using a new window.
  208. *
  209. * Init with new window with custom width
  210. */
  211. - (instancetype)initWithNewWindowWidth:(CGFloat)windowWidth;
  212. /** Warns that alerts is gone
  213. *
  214. * Warns that alerts is gone using block
  215. */
  216. - (void)alertIsDismissed:(SCLDismissBlock)dismissBlock;
  217. /** Warns that alerts dismiss animation is completed
  218. *
  219. * Warns that alerts dismiss animation is completed
  220. */
  221. - (void)alertDismissAnimationIsCompleted:(SCLDismissAnimationCompletionBlock)dismissAnimationCompletionBlock;
  222. /** Warns that alerts show animation is completed
  223. *
  224. * Warns that alerts show animation is completed
  225. */
  226. - (void)alertShowAnimationIsCompleted:(SCLShowAnimationCompletionBlock)showAnimationCompletionBlock;
  227. /** Hide SCLAlertView
  228. *
  229. * Hide SCLAlertView using animation and removing from super view.
  230. */
  231. - (void)hideView;
  232. /** SCLAlertView visibility
  233. *
  234. * Returns if the alert is visible or not.
  235. */
  236. - (BOOL)isVisible;
  237. /** Remove Top Circle
  238. *
  239. * Remove top circle from SCLAlertView.
  240. */
  241. - (void)removeTopCircle;
  242. /** Add a custom UIView
  243. *
  244. * @param customView UIView object to be added above the first SCLButton.
  245. */
  246. - (UIView *)addCustomView:(UIView *)customView;
  247. /** Add Text Field
  248. *
  249. * @param title The text displayed on the textfield.
  250. */
  251. - (SCLTextView *)addTextField:(NSString *)title;
  252. /** Add a custom Text Field
  253. *
  254. * @param textField The custom textfield provided by the programmer.
  255. */
  256. - (void)addCustomTextField:(UITextField *)textField;
  257. /** Add a switch view
  258. *
  259. * @param label The label displayed for the switch.
  260. */
  261. - (SCLSwitchView *)addSwitchViewWithLabel:(NSString *)label;
  262. /** Add Timer Display
  263. *
  264. * @param buttonIndex The index of the button to add the timer display to.
  265. * @param reverse Convert timer to countdown.
  266. */
  267. - (void)addTimerToButtonIndex:(NSInteger)buttonIndex reverse:(BOOL)reverse;
  268. /** Set Title font family and size
  269. *
  270. * @param titleFontFamily The family name used to displayed the title.
  271. * @param size Font size.
  272. */
  273. - (void)setTitleFontFamily:(NSString *)titleFontFamily withSize:(CGFloat)size;
  274. /** Set Text field font family and size
  275. *
  276. * @param bodyTextFontFamily The family name used to displayed the text field.
  277. * @param size Font size.
  278. */
  279. - (void)setBodyTextFontFamily:(NSString *)bodyTextFontFamily withSize:(CGFloat)size;
  280. /** Set Buttons font family and size
  281. *
  282. * @param buttonsFontFamily The family name used to displayed the buttons.
  283. * @param size Font size.
  284. */
  285. - (void)setButtonsTextFontFamily:(NSString *)buttonsFontFamily withSize:(CGFloat)size;
  286. /** Add a Button with a title and a block to handle when the button is pressed.
  287. *
  288. * @param title The text displayed on the button.
  289. * @param action A block of code to be executed when the button is pressed.
  290. */
  291. - (SCLButton *)addButton:(NSString *)title actionBlock:(SCLActionBlock)action;
  292. /** Add a Button with a title, a block to handle validation, and a block to handle when the button is pressed and validation succeeds.
  293. *
  294. * @param title The text displayed on the button.
  295. * @param validationBlock A block of code that will allow you to validate fields or do any other logic you may want to do to determine if the alert should be dismissed or not. Inside of this block, return a BOOL indicating whether or not the action block should be called and the alert dismissed.
  296. * @param action A block of code to be executed when the button is pressed and validation passes.
  297. */
  298. - (SCLButton *)addButton:(NSString *)title validationBlock:(SCLValidationBlock)validationBlock actionBlock:(SCLActionBlock)action;
  299. /** Add a Button with a title, a target and a selector to handle when the button is pressed.
  300. *
  301. * @param title The text displayed on the button.
  302. * @param target Add target for particular event.
  303. * @param selector A method to be executed when the button is pressed.
  304. */
  305. - (SCLButton *)addButton:(NSString *)title target:(id)target selector:(SEL)selector;
  306. /** Show Success SCLAlertView
  307. *
  308. * @param vc The view controller the alert view will be displayed in.
  309. * @param title The text displayed on the button.
  310. * @param subTitle The subtitle text of the alert view.
  311. * @param closeButtonTitle The text for the close button.
  312. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  313. */
  314. - (void)showSuccess:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  315. - (void)showSuccess:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  316. /** Show Error SCLAlertView
  317. *
  318. * @param vc The view controller the alert view will be displayed in.
  319. * @param title The text displayed on the button.
  320. * @param subTitle The subtitle text of the alert view.
  321. * @param closeButtonTitle The text for the close button.
  322. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  323. */
  324. - (void)showError:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  325. - (void)showError:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  326. /** Show Notice SCLAlertView
  327. *
  328. * @param vc The view controller the alert view will be displayed in.
  329. * @param title The text displayed on the button.
  330. * @param subTitle The subtitle text of the alert view.
  331. * @param closeButtonTitle The text for the close button.
  332. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  333. */
  334. - (void)showNotice:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  335. - (void)showNotice:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  336. /** Show Warning SCLAlertView
  337. *
  338. * @param vc The view controller the alert view will be displayed in.
  339. * @param title The text displayed on the button.
  340. * @param subTitle The subtitle text of the alert view.
  341. * @param closeButtonTitle The text for the close button.
  342. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  343. */
  344. - (void)showWarning:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  345. - (void)showWarning:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  346. /** Show Info SCLAlertView
  347. *
  348. * @param vc The view controller the alert view will be displayed in.
  349. * @param title The text displayed on the button.
  350. * @param subTitle The subtitle text of the alert view.
  351. * @param closeButtonTitle The text for the close button.
  352. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  353. */
  354. - (void)showInfo:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  355. - (void)showInfo:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  356. /** Show Edit SCLAlertView
  357. *
  358. * @param vc The view controller the alert view will be displayed in.
  359. * @param title The text displayed on the button.
  360. * @param subTitle The subtitle text of the alert view.
  361. * @param closeButtonTitle The text for the close button.
  362. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  363. */
  364. - (void)showEdit:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  365. - (void)showEdit:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  366. /** Show Title SCLAlertView using a predefined type
  367. *
  368. * @param vc The view controller the alert view will be displayed in.
  369. * @param title The text displayed on the button.
  370. * @param subTitle The subtitle text of the alert view.
  371. * @param style One of predefined SCLAlertView styles.
  372. * @param closeButtonTitle The text for the close button.
  373. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  374. */
  375. - (void)showTitle:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle style:(SCLAlertViewStyle)style closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  376. - (void)showTitle:(NSString *)title subTitle:(NSString *)subTitle style:(SCLAlertViewStyle)style closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  377. /** Shows a custom SCLAlertView without using a predefined type, allowing for a custom image and color to be specified.
  378. *
  379. * @param vc The view controller the alert view will be displayed in.
  380. * @param image A UIImage object to be used as the icon for the alert view.
  381. * @param color A UIColor object to be used to tint the background of the icon circle and the buttons.
  382. * @param title The title text of the alert view.
  383. * @param subTitle The subtitle text of the alert view.
  384. * @param closeButtonTitle The text for the close button.
  385. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  386. */
  387. - (void)showCustom:(UIViewController *)vc image:(UIImage *)image color:(UIColor *)color title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  388. - (void)showCustom:(UIImage *)image color:(UIColor *)color title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  389. /** Show Waiting SCLAlertView with UIActityIndicator.
  390. *
  391. * @param vc The view controller the alert view will be displayed in.
  392. * @param title The text displayed on the button.
  393. * @param subTitle The subtitle text of the alert view.
  394. * @param closeButtonTitle The text for the close button.
  395. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  396. */
  397. - (void)showWaiting:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  398. - (void)showWaiting:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  399. /** Show Question SCLAlertView
  400. *
  401. * @param vc The view controller the alert view will be displayed in.
  402. * @param title The text displayed on the button.
  403. * @param subTitle The subtitle text of the alert view.
  404. * @param closeButtonTitle The text for the close button.
  405. * @param duration The amount of time the alert will remain on screen until it is automatically dismissed. If automatic dismissal is not desired, set to 0.
  406. */
  407. - (void)showQuestion:(UIViewController *)vc title:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  408. - (void)showQuestion:(NSString *)title subTitle:(NSString *)subTitle closeButtonTitle:(NSString *)closeButtonTitle duration:(NSTimeInterval)duration;
  409. @end
  410. @protocol SCLItemsBuilder__Protocol__Fluent <NSObject>
  411. - (void)setupFluent;
  412. @end
  413. @interface SCLAlertViewBuilder__WithFluent: NSObject <SCLItemsBuilder__Protocol__Fluent> @end
  414. @interface SCLAlertViewShowBuilder : SCLAlertViewBuilder__WithFluent
  415. @property(weak, nonatomic, readonly) UIViewController *parameterViewController;
  416. @property(copy, nonatomic, readonly) UIImage *parameterImage;
  417. @property(copy, nonatomic, readonly) UIColor *parameterColor;
  418. @property(copy, nonatomic, readonly) NSString *parameterTitle;
  419. @property(copy, nonatomic, readonly) NSString *parameterSubTitle;
  420. @property(copy, nonatomic, readonly) NSString *parameterCompleteText;
  421. @property(copy, nonatomic, readonly) NSString *parameterCloseButtonTitle;
  422. @property(assign, nonatomic, readonly) SCLAlertViewStyle parameterStyle;
  423. @property(assign, nonatomic, readonly) NSTimeInterval parameterDuration;
  424. #pragma mark - Setters
  425. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^viewController)(UIViewController *viewController);
  426. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^image)(UIImage *image);
  427. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^color)(UIColor *color);
  428. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^title)(NSString *title);
  429. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^subTitle)(NSString *subTitle);
  430. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^completeText)(NSString *completeText);
  431. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^style)(SCLAlertViewStyle style);
  432. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^closeButtonTitle)(NSString *closeButtonTitle);
  433. @property(copy, nonatomic, readonly) SCLAlertViewShowBuilder *(^duration)(NSTimeInterval duration);
  434. - (void)showAlertView:(SCLAlertView *)alertView;
  435. - (void)showAlertView:(SCLAlertView *)alertView onViewController:(UIViewController *)controller;
  436. @property(copy, nonatomic, readonly) void (^show)(SCLAlertView *view, UIViewController *controller);
  437. @end
  438. @interface SCLALertViewTextFieldBuilder : SCLAlertViewBuilder__WithFluent
  439. #pragma mark - Available later after adding
  440. @property(weak, nonatomic, readonly) SCLTextView *textField;
  441. #pragma mark - Setters
  442. @property(copy, nonatomic, readonly) SCLALertViewTextFieldBuilder *(^title) (NSString *title);
  443. @end
  444. @interface SCLALertViewButtonBuilder : SCLAlertViewBuilder__WithFluent
  445. #pragma mark - Available later after adding
  446. @property(weak, nonatomic, readonly) SCLButton *button;
  447. #pragma mark - Setters
  448. @property(copy, nonatomic, readonly) SCLALertViewButtonBuilder *(^title) (NSString *title);
  449. @property(copy, nonatomic, readonly) SCLALertViewButtonBuilder *(^target) (id target);
  450. @property(copy, nonatomic, readonly) SCLALertViewButtonBuilder *(^selector) (SEL selector);
  451. @property(copy, nonatomic, readonly) SCLALertViewButtonBuilder *(^actionBlock) (void(^actionBlock)(void));
  452. @property(copy, nonatomic, readonly) SCLALertViewButtonBuilder *(^validationBlock) (BOOL(^validationBlock)(void));
  453. @end
  454. @interface SCLAlertViewBuilder : SCLAlertViewBuilder__WithFluent
  455. #pragma mark - Parameters
  456. @property (strong, nonatomic, readonly) SCLAlertView *alertView;
  457. #pragma mark - Init
  458. - (instancetype)init;
  459. - (instancetype)initWithNewWindow;
  460. - (instancetype)initWithNewWindowWidth:(CGFloat)width;
  461. #pragma mark - Properties
  462. @property(copy, nonatomic) SCLAlertViewBuilder *(^cornerRadius) (CGFloat cornerRadius);
  463. @property(copy, nonatomic) SCLAlertViewBuilder *(^tintTopCircle) (BOOL tintTopCircle);
  464. @property(copy, nonatomic) SCLAlertViewBuilder *(^useLargerIcon) (BOOL useLargerIcon);
  465. @property(copy, nonatomic) SCLAlertViewBuilder *(^labelTitle) (UILabel *labelTitle);
  466. @property(copy, nonatomic) SCLAlertViewBuilder *(^viewText) (UITextView *viewText);
  467. @property(copy, nonatomic) SCLAlertViewBuilder *(^activityIndicatorView) (UIActivityIndicatorView *activityIndicatorView);
  468. @property(copy, nonatomic) SCLAlertViewBuilder *(^shouldDismissOnTapOutside) (BOOL shouldDismissOnTapOutside);
  469. @property(copy, nonatomic) SCLAlertViewBuilder *(^soundURL) (NSURL *soundURL);
  470. @property(copy, nonatomic) SCLAlertViewBuilder *(^attributedFormatBlock) (SCLAttributedFormatBlock attributedFormatBlock);
  471. @property(copy, nonatomic) SCLAlertViewBuilder *(^completeButtonFormatBlock) (CompleteButtonFormatBlock completeButtonFormatBlock);
  472. @property(copy, nonatomic) SCLAlertViewBuilder *(^buttonFormatBlock) (ButtonFormatBlock buttonFormatBlock);
  473. @property(copy, nonatomic) SCLAlertViewBuilder *(^forceHideBlock) (SCLForceHideBlock forceHideBlock);
  474. @property(copy, nonatomic) SCLAlertViewBuilder *(^hideAnimationType) (SCLAlertViewHideAnimation hideAnimationType);
  475. @property(copy, nonatomic) SCLAlertViewBuilder *(^showAnimationType) (SCLAlertViewShowAnimation showAnimationType);
  476. @property(copy, nonatomic) SCLAlertViewBuilder *(^backgroundType) (SCLAlertViewBackground backgroundType);
  477. @property(copy, nonatomic) SCLAlertViewBuilder *(^customViewColor) (UIColor *customViewColor);
  478. @property(copy, nonatomic) SCLAlertViewBuilder *(^backgroundViewColor) (UIColor *backgroundViewColor);
  479. @property(copy, nonatomic) SCLAlertViewBuilder *(^iconTintColor) (UIColor *iconTintColor);
  480. @property(copy, nonatomic) SCLAlertViewBuilder *(^circleIconHeight) (CGFloat circleIconHeight);
  481. @property(copy, nonatomic) SCLAlertViewBuilder *(^extensionBounds) (CGRect extensionBounds);
  482. @property(copy, nonatomic) SCLAlertViewBuilder *(^statusBarHidden) (BOOL statusBarHidden);
  483. @property(copy, nonatomic) SCLAlertViewBuilder *(^statusBarStyle) (UIStatusBarStyle statusBarStyle);
  484. #pragma mark - Custom Setters
  485. @property(copy, nonatomic) SCLAlertViewBuilder *(^alertIsDismissed) (SCLDismissBlock dismissBlock);
  486. @property(copy, nonatomic) SCLAlertViewBuilder *(^alertDismissAnimationIsCompleted) (SCLDismissAnimationCompletionBlock dismissAnimationCompletionBlock);
  487. @property(copy, nonatomic) SCLAlertViewBuilder *(^alertShowAnimationIsCompleted) (SCLShowAnimationCompletionBlock showAnimationCompletionBlock);
  488. @property(copy, nonatomic) SCLAlertViewBuilder *(^removeTopCircle)(void);
  489. @property(copy, nonatomic) SCLAlertViewBuilder *(^addCustomView)(UIView *view);
  490. @property(copy, nonatomic) SCLAlertViewBuilder *(^addTextField)(NSString *title);
  491. @property(copy, nonatomic) SCLAlertViewBuilder *(^addCustomTextField)(UITextField *textField);
  492. @property(copy, nonatomic) SCLAlertViewBuilder *(^addSwitchViewWithLabelTitle)(NSString *title);
  493. @property(copy, nonatomic) SCLAlertViewBuilder *(^addTimerToButtonIndex)(NSInteger buttonIndex, BOOL reverse);
  494. @property(copy, nonatomic) SCLAlertViewBuilder *(^setTitleFontFamily)(NSString *titleFontFamily, CGFloat size);
  495. @property(copy, nonatomic) SCLAlertViewBuilder *(^setBodyTextFontFamily)(NSString *bodyTextFontFamily, CGFloat size);
  496. @property(copy, nonatomic) SCLAlertViewBuilder *(^setButtonsTextFontFamily)(NSString *buttonsFontFamily, CGFloat size);
  497. @property(copy, nonatomic) SCLAlertViewBuilder *(^addButtonWithActionBlock)(NSString *title, SCLActionBlock action);
  498. @property(copy, nonatomic) SCLAlertViewBuilder *(^addButtonWithValidationBlock)(NSString *title, SCLValidationBlock validationBlock, SCLActionBlock action);
  499. @property(copy, nonatomic) SCLAlertViewBuilder *(^addButtonWithTarget)(NSString *title, id target, SEL selector);
  500. #pragma mark - Builders
  501. @property(copy, nonatomic) SCLAlertViewBuilder *(^addButtonWithBuilder)(SCLALertViewButtonBuilder *builder);
  502. @property(copy, nonatomic) SCLAlertViewBuilder *(^addTextFieldWithBuilder)(SCLALertViewTextFieldBuilder *builder);
  503. @end