CustomAlertView.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 CustomLabel *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 CustomButton *btnCancelSingle;
  41. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
  42. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnConfirmWidth;
  43. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintPopupHeight;
  44. /**
  45. 커스텀 얼럿을 제공한다.
  46. @param title
  47. 얼럿타이틀
  48. @param message
  49. 메시지
  50. @param delegate
  51. 딜리게이트
  52. @param okButtonTitle
  53. OK버튼이름
  54. @param cancelButtonTitle
  55. Cancel버튼이름
  56. @return CustomAlert*
  57. */
  58. - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate OKButtonTitle:(NSString *)okButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle;
  59. - (void)show;
  60. - (void)showWithCompletion:(CustomAlertViewCallBackHandler)completion;
  61. - (void)hide;
  62. - (IBAction)btnConfirmTouched:(id)sender;
  63. - (IBAction)btnCancelTouched:(id)sender;
  64. - (IBAction)btnCancelSingleTouched:(id)sender;
  65. @end