// // 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 "DateSelectPopupView.h" @interface DateSelectPopupView () { } @end @implementation DateSelectPopupView - (id)initFromNib { for (UIView *view in [CommonUtil nibViews:@"DateSelectPopupView"]) { if ([view isKindOfClass:[DateSelectPopupView class]]) { self = (DateSelectPopupView *)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]; } } return self; } - (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