InvitationAnswerPopupView.m 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // InvitationAnswerPopupView
  3. // kneet
  4. //
  5. // Created by Jason Lee on 6/15/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. #import "JDObject.h"
  9. #import "CustomLabel.h"
  10. #import "CustomCheckBox.h"
  11. #import "InvitationAnswerPopupView.h"
  12. #import "LoginModel.h"
  13. #import "DatePickerButton.h"
  14. @interface InvitationAnswerPopupView () {
  15. }
  16. @end
  17. @implementation InvitationAnswerPopupView
  18. - (id)initFromNib {
  19. for (UIView *view in [CommonUtil nibViews:@"InvitationAnswerPopupView"]) {
  20. if ([view isKindOfClass:[InvitationAnswerPopupView class]]) {
  21. self = (InvitationAnswerPopupView *)view;
  22. //XIB의 경우, 현재 화면 사이즈로 맞춰줘야 함.
  23. self.frame = [UIScreen mainScreen].bounds;
  24. _btnDate.date = [NSDate date];
  25. _btnDate.placeHolder = _btnDate.dateString;
  26. [self.btnConfirm setTitle:NSLocalizedString(@"확인", @"확인") forState:UIControlStateNormal];
  27. [self.btnCancel setTitle:NSLocalizedString(@"취소", @"취소") forState:UIControlStateNormal];
  28. }
  29. }
  30. return self;
  31. }
  32. - (void)didMoveToSuperview {
  33. }
  34. - (NSString *)selectedDate {
  35. return _btnDate.dateString ? _btnDate.dateString : ksEmptyString;
  36. }
  37. - (void)btnConfirmTouched:(id)sender {
  38. //validate
  39. if (!_btnDate.date) {
  40. [[JDFacade facade] alert:NSLocalizedString(@"날짜를 선택해주세요", @"날짜를 선택해주세요")];
  41. return;
  42. }
  43. [super btnConfirmTouched:sender];
  44. }
  45. @end