LCActionSheetConfig.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. //
  2. // LCActionSheetConfig.h
  3. // LCActionSheet
  4. //
  5. // Created by Leo on 2016/11/29.
  6. //
  7. // Copyright (c) 2015-2017 Leo <leodaxia@gmail.com>
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining a copy
  10. // of this software and associated documentation files (the "Software"), to deal
  11. // in the Software without restriction, including without limitation the rights
  12. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. // copies of the Software, and to permit persons to whom the Software is
  14. // furnished to do so, subject to the following conditions:
  15. //
  16. // The above copyright notice and this permission notice shall be included in all
  17. // copies or substantial portions of the Software.
  18. //
  19. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  25. // SOFTWARE.
  26. #import <UIKit/UIKit.h>
  27. #define LC_ACTION_SHEET_COLOR(r, g, b) LC_ACTION_SHEET_COLOR_A(r, g, b, 1.0f)
  28. #define LC_ACTION_SHEET_COLOR_A(r, g, b, a) [UIColor colorWithRed:(r)/255.0f\
  29. green:(g)/255.0f\
  30. blue:(b)/255.0f\
  31. alpha:a]
  32. NS_ASSUME_NONNULL_BEGIN
  33. @interface LCActionSheetConfig : NSObject
  34. /**
  35. Title.
  36. */
  37. @property (nullable, nonatomic, copy) NSString *title;
  38. /**
  39. Cancel button's title.
  40. */
  41. @property (nullable, nonatomic, copy) NSString *cancelButtonTitle;
  42. /**
  43. Cancel button's index.
  44. */
  45. @property (nonatomic, assign, readonly) NSInteger cancelButtonIndex;
  46. /**
  47. All destructive buttons' set. You should give it the `NSNumber` type items.
  48. */
  49. @property (nullable, nonatomic, strong) NSIndexSet *destructiveButtonIndexSet;
  50. /**
  51. Destructive button's color. Default is RGB(254, 67, 37).
  52. */
  53. @property (nonatomic, strong) UIColor *destructiveButtonColor;
  54. /**
  55. Title's color. Default is `[UIColor blackColor]`.
  56. */
  57. @property (nonatomic, strong) UIColor *titleColor;
  58. /**
  59. Buttons' color, without destructive buttons. Default is `[UIColor blackColor]`.
  60. */
  61. @property (nonatomic, strong) UIColor *buttonColor;
  62. /**
  63. Title's font. Default is `[UIFont systemFontOfSize:14.0f]`.
  64. */
  65. @property (nonatomic, strong) UIFont *titleFont;
  66. /**
  67. All buttons' font. Default is `[UIFont systemFontOfSize:18.0f]`.
  68. */
  69. @property (nonatomic, strong) UIFont *buttonFont;
  70. /**
  71. All buttons' height. Default is 49.0f;
  72. */
  73. @property (nonatomic, assign) CGFloat buttonHeight;
  74. /**
  75. If buttons' bottom view can scrolling. Default is NO.
  76. */
  77. @property (nonatomic, assign, getter=canScrolling) BOOL scrolling;
  78. /**
  79. Visible buttons' count. You have to set `scrolling = YES` if you want to set it.
  80. */
  81. @property (nonatomic, assign) CGFloat visibleButtonCount;
  82. /**
  83. Animation duration. Default is 0.3 seconds.
  84. */
  85. @property (nonatomic, assign) CGFloat animationDuration;
  86. /**
  87. Opacity of dark background. Default is 0.3f.
  88. */
  89. @property (nonatomic, assign) CGFloat darkOpacity;
  90. /**
  91. If you can tap darkView to dismiss. Defalut is NO, you can tap dardView to dismiss.
  92. */
  93. @property (nonatomic, assign) BOOL darkViewNoTaped;
  94. /**
  95. Clear blur effect. Default is NO, don't clear blur effect.
  96. */
  97. @property (nonatomic, assign) BOOL unBlur;
  98. /**
  99. Style of blur effect. Default is `UIBlurEffectStyleExtraLight`. iOS 8.0 +
  100. */
  101. @property (nonatomic, assign) UIBlurEffectStyle blurEffectStyle;
  102. /**
  103. Title's edge insets. Default is `UIEdgeInsetsMake(15.0f, 15.0f, 15.0f, 15.0f)`.
  104. */
  105. @property (nonatomic, assign) UIEdgeInsets titleEdgeInsets;
  106. /**
  107. Cell's separator color. Default is `RGBA(170/255.0f, 170/255.0f, 170/255.0f, 0.5f)`.
  108. */
  109. @property (nonatomic, strong) UIColor *separatorColor;
  110. /**
  111. Auto hide when the device rotated. Default is NO, won't auto hide.
  112. */
  113. @property (nonatomic, assign) BOOL autoHideWhenDeviceRotated;
  114. /**
  115. LCActionSheetConfig shared instance.
  116. */
  117. @property (class, nonatomic, strong, readonly) LCActionSheetConfig *config;
  118. /**
  119. LCActionSheetConfig shared instance.
  120. */
  121. + (instancetype)shared __deprecated_msg("Method deprecated. Use property `config` instead.");
  122. @end
  123. NS_ASSUME_NONNULL_END