CustomAlertView.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #import "CustomImageView.h"
  13. #define kfLabelTopMargin 15.0f
  14. #define kfLabelBottomMargin 15.0f
  15. #define kfLabelMargin 15.0f
  16. #define kfButtonOriginX 15.0f
  17. #define kfButtonMargin 10.0f
  18. #define kfBottomMargin 15.0f
  19. #define kfBodyMargin 2.0f
  20. #define kfTopInset 0
  21. #define kfRightInset 20
  22. #define kfBottomInset 0
  23. #define kfLeftInset 20
  24. @class CustomAlertView;
  25. typedef void(^CustomAlertViewCallBackHandler)(CustomAlertView *alertView, NSInteger buttonIndex);
  26. @interface CustomAlertView : UIView {
  27. @protected
  28. NSString *_okButtonTitle, *_cancelButtonTitle;
  29. }
  30. @property (weak, nonatomic) IBOutlet UIView *popUpView;
  31. @property (weak, nonatomic) IBOutlet UIView *containerView;
  32. @property (weak, nonatomic) IBOutlet UIView *maskingView;
  33. @property (weak, nonatomic) IBOutlet UILabel *lblTitle;
  34. @property (weak, nonatomic) IBOutlet CustomLabel *lblMessage1;
  35. @property (weak, nonatomic) IBOutlet CustomImageView *imgTitleBar;
  36. @property (weak, nonatomic) IBOutlet UIImageView *popUpTitleImage;
  37. @property (weak, nonatomic) IBOutlet CustomButton *btnConfirm;
  38. @property (weak, nonatomic) IBOutlet CustomButton *btnCancel;
  39. @property (weak, nonatomic) IBOutlet CustomButton *btnConfirmSingle;
  40. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
  41. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnConfirmWidth;
  42. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintPopupHeight;
  43. /**
  44. 커스텀 얼럿을 제공한다.
  45. @param title
  46. 얼럿타이틀
  47. @param message
  48. 메시지
  49. @param delegate
  50. 딜리게이트
  51. @param okButtonTitle
  52. OK버튼이름
  53. @param cancelButtonTitle
  54. Cancel버튼이름
  55. @return CustomAlert*
  56. */
  57. - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate OKButtonTitle:(NSString *)okButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle;
  58. - (void)show;
  59. - (void)showWithCompletion:(CustomAlertViewCallBackHandler)completion;
  60. - (void)hide;
  61. - (IBAction)btnConfirmTouched:(id)sender;
  62. - (IBAction)btnCancelTouched:(id)sender;
  63. @end