MMAlertView.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // MMAlertView.h
  3. // MMPopupView
  4. //
  5. // Created by Ralph Li on 9/6/15.
  6. // Copyright © 2015 LJC. All rights reserved.
  7. //
  8. #import "MMPopupView.h"
  9. #import "MMPopupDefine.h"
  10. typedef void(^MMPopupInputHandler)(NSString *text);
  11. @interface MMAlertView : MMPopupView
  12. @property (nonatomic, assign) NSUInteger maxInputLength; // default is 0. Means no length limit.
  13. - (instancetype) initWithInputTitle:(NSString*)title
  14. detail:(NSString*)detail
  15. placeholder:(NSString*)inputPlaceholder
  16. keyboardType:(UIKeyboardType)keyboardType
  17. items:(NSArray*)items
  18. handler:(MMPopupInputHandler)inputHandler;
  19. - (instancetype) initWithConfirmTitle:(NSString*)title
  20. detail:(NSString*)detail;
  21. - (instancetype) initWithTitle:(NSString*)title
  22. detail:(NSString*)detail
  23. items:(NSArray*)items;
  24. @end
  25. /**
  26. * Global Configuration of MMAlertView.
  27. */
  28. @interface MMAlertViewConfig : NSObject
  29. + (MMAlertViewConfig*) globalConfig;
  30. @property (nonatomic, assign) CGFloat width; // Default is 275.
  31. @property (nonatomic, assign) CGFloat buttonHeight; // Default is 50.
  32. @property (nonatomic, assign) CGFloat innerMargin; // Default is 25.
  33. @property (nonatomic, assign) CGFloat cornerRadius; // Default is 6.
  34. @property (nonatomic, assign) CGFloat titleFontSize; // Default is 17.
  35. @property (nonatomic, assign) CGFloat detailFontSize; // Default is 14.
  36. @property (nonatomic, assign) CGFloat buttonFontSize; // Default is 17.
  37. @property (nonatomic, strong) UIColor *backgroundColor; // Default is #FFFFFF.
  38. @property (nonatomic, strong) UIColor *titleColor; // Default is #333333.
  39. @property (nonatomic, strong) UIColor *detailColor; // Default is #333333.
  40. @property (nonatomic, strong) UIColor *splitColor; // Default is #CCCCCC.
  41. @property (nonatomic, strong) UIColor *itemNormalColor; // Default is #333333. effect with MMItemTypeNormal
  42. @property (nonatomic, strong) UIColor *itemHighlightColor; // Default is #E76153. effect with MMItemTypeHighlight
  43. @property (nonatomic, strong) UIColor *itemPressedColor; // Default is #EFEDE7.
  44. @property (nonatomic, strong) NSString *defaultTextOK; // Default is "知道了".
  45. @property (nonatomic, strong) NSString *defaultTextCancel; // Default is "取消".
  46. @property (nonatomic, strong) NSString *defaultTextConfirm; // Default is "确定".
  47. @end