CustomAlertView.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 CustomLabel *lblMessage1;
  30. @property (weak, nonatomic) IBOutlet CustomButton *btnConfirm;
  31. @property (weak, nonatomic) IBOutlet CustomButton *btnCancel;
  32. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
  33. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnConfirmWidth;
  34. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintPopupHeight;
  35. /**
  36. 커스텀 얼럿을 제공한다.
  37. @param title
  38. 얼럿타이틀
  39. @param message
  40. 메시지
  41. @param delegate
  42. 딜리게이트
  43. @param okButtonTitle
  44. OK버튼이름
  45. @param cancelButtonTitle
  46. Cancel버튼이름
  47. @return CustomAlert*
  48. */
  49. - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate OKButtonTitle:(NSString *)okButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle;
  50. - (void)show;
  51. - (void)showWithCompletion:(CustomAlertViewCallBackHandler)completion;
  52. - (void)hide;
  53. - (IBAction)btnConfirmTouched:(id)sender;
  54. - (IBAction)btnCancelTouched:(id)sender;
  55. @end