| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- //
- // DateSelectPopupView.m
- // OneCable
- //
- // Created by nComz on 2017. 4. 11..
- // Copyright © 2017년 ntels. All rights reserved.
- //
- #import "JDObject.h"
- #import "CustomLabel.h"
- #import "CustomButton.h"
- #import "CustomTextField.h"
- #import "CustomDatePopupView.h"
- @interface CustomDatePopupView () <CustomTextFieldDelegate>
- {
-
- }
- @end
- @implementation CustomDatePopupView
- - (id)initFromNib {
- for (UIView *view in [CommonUtil nibViews:@"CustomDatePopupView"]) {
- if ([view isKindOfClass:[CustomDatePopupView class]]) {
- self = (CustomDatePopupView *)view;
-
- //XIB의 경우, 현재 화면 사이즈로 맞춰줘야 함.
- self.frame = [UIScreen mainScreen].bounds;
-
- // _txtYear.delegate = self;
- // _txtYear.keyboardType = UIKeyboardTypePhonePad;
- // _txtYear.returnKeyType = UIReturnKeyNext;
- //
- // _txtMonth.delegate = self;
- // _txtMonth.keyboardType = UIKeyboardTypePhonePad;
- // _txtMonth.returnKeyType = UIReturnKeyNext;
- //
- // _txtDay.delegate = self;
- // _txtMonth.keyboardType = UIKeyboardTypePhonePad;
- // _txtMonth.returnKeyType = UIReturnKeyDone;
-
- [self.imgTitleBar setImage:[UIImage imageNamed:@"img_popup_bg_head"]inset:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
-
- [self.btnConfirm setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_right"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
- [self.btnConfirm setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_right_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
-
-
- [self.btnCancel setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_left"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
- [self.btnCancel setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_left_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
-
- [self.btnConfirm setTitle:NSLocalizedString(@"확인", @"확인") forState:UIControlStateNormal];
- [self.btnCancel setTitle:NSLocalizedString(@"취소", @"취소") forState:UIControlStateNormal];
-
- [self setTitle:@"정답 날짜 입력"];
- }
- }
-
- return self;
- }
- - (void)setTitle:(NSString *)title {
- self.lblTitle.text = title;
- }
- - (void)didMoveToSuperview {
- if (!self.superview) {
- return;
- }
- // _txtYear.customTextFieldSuperview = CustomTextFieldSuperviewIsPopupContentView;
- // _txtMonth.customTextFieldSuperview = CustomTextFieldSuperviewIsPopupContentView;
- // _txtDay.customTextFieldSuperview = CustomTextFieldSuperviewIsPopupContentView;
- }
- - (void)btnConfirmTouched:(id)sender {
-
- NSLog(@"확인");
- }
- #pragma mark - CustomTextField
- - (BOOL)textFieldShouldReturn:(UITextField *)textField {
- // if ([textField isEqual:_txtDay]) {
- // [self btnConfirmTouched:nil];
- // }
- // if ([textField isEqual:_txtMonth]) {
- // [_txtDay becomeFirstResponder];
- // }
- // if ([textField isEqual:_txtYear]) {
- // [_txtMonth becomeFirstResponder];
- // }
- return YES;
- }
- @end
|