CustomAlertView.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // CustomAlertView.h
  3. // JasonDevelop
  4. //
  5. // Created by Jason Lee on 3/6/14.
  6. // Copyright (c) jasondevelop. All rights reserved.
  7. //
  8. @import UIKit;
  9. #import "CustomLabel.h"
  10. #import "CustomButton.h"
  11. #import "CommonUtil.h"
  12. #define kfLabelTopMargin 15.0f
  13. #define kfLabelBottomMargin 15.0f
  14. #define kfLabelMargin 15.0f
  15. #define kfButtonOriginX 15.0f
  16. #define kfButtonMargin 10.0f
  17. #define kfBottomMargin 15.0f
  18. #define kfBodyMargin 2.0f
  19. @class CustomAlertView;
  20. typedef void(^CustomAlertViewCallBackHandler)(CustomAlertView *alertView, NSInteger buttonIndex);
  21. @interface CustomAlertView : UIView {
  22. @protected
  23. NSString *_okButtonTitle, *_cancelButtonTitle;
  24. }
  25. @property (weak, nonatomic) IBOutlet UIView *popUpView;
  26. @property (weak, nonatomic) IBOutlet UIView *containerView;
  27. @property (weak, nonatomic) IBOutlet UIView *maskingView;
  28. @property (weak, nonatomic) IBOutlet UILabel *lblTitle;
  29. @property (weak, nonatomic) IBOutlet UILabel *lblBoldMessage;
  30. @property (weak, nonatomic) IBOutlet CustomLabel *lblMessage1;
  31. @property (weak, nonatomic) IBOutlet CustomLabel *lblMessage2;
  32. @property (weak, nonatomic) IBOutlet CustomButton *btnConfirm;
  33. @property (weak, nonatomic) IBOutlet CustomButton *btnCancel;
  34. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
  35. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnConfirmWidth;
  36. /**
  37. 커스텀 얼럿을 제공한다.
  38. @param title
  39. 얼럿타이틀
  40. @param message
  41. 메시지
  42. @param delegate
  43. 딜리게이트
  44. @param okButtonTitle
  45. OK버튼이름
  46. @param cancelButtonTitle
  47. Cancel버튼이름
  48. @return CustomAlert*
  49. */
  50. - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate OKButtonTitle:(NSString *)okButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle;
  51. /**
  52. 커스텀 얼럿을 제공한다.
  53. @param title
  54. 얼럿타이틀
  55. @param delegate
  56. 딜리게이트
  57. @param okButtonTitle
  58. OK버튼이름
  59. @param cancelButtonTitle
  60. Cancel버튼이름
  61. @param message...
  62. 상단볼드 메시지, 중간 메시지, 하단 메시지순서
  63. @return CustomAlert*
  64. */
  65. - (id)initWithTitle:(NSString *)title delegate:(id)delegate OKButtonTitle:(NSString *)okButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle message:(NSString *)messages,... NS_REQUIRES_NIL_TERMINATION;
  66. - (void)show;
  67. - (void)showWithCompletion:(CustomAlertViewCallBackHandler)completion;
  68. - (IBAction)btnConfirmTouched:(id)sender;
  69. - (IBAction)btnCancelTouched:(id)sender;
  70. @end