// // ChangePhotoPopupView.m // OneCable // // Created by nComz on 2017. 4. 26.. // Copyright © 2017년 ntels. All rights reserved. // #import "ChangePhotoPopupView.h" #import "ImageUtil.h" #import "JDFacade.h" @interface ChangePhotoPopupView () @end @implementation ChangePhotoPopupView - (id)initFromNib { for (UIView *view in [CommonUtil nibViews:@"ChangePhotoPopupView"]) { if ([view isKindOfClass:[ChangePhotoPopupView class]]) { self = (ChangePhotoPopupView *)view; //XIB의 경우, 현재 화면 사이즈로 맞춰줘야 함. self.frame = [UIScreen mainScreen].bounds; self.lblTitle.text = NSLocalizedString(@"사진 선택", @"사진 선택"); [self.imgTitleBar setImage:[UIImage imageNamed:@"img_popup_bg_head"]inset:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)]; [self.btnCancelSingle setBackgroundImage:[UIImage imageNamed:@"img_popup_btn"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)]; [self.btnCancelSingle setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)]; //Localization [self.btnCancelSingle setTitle:NSLocalizedString(@"취소", @"취소") forState:UIControlStateNormal]; } } return self; } - (IBAction)btnPhotoSelectTouched:(id)sender { NSLog(@"갤러리로 이동"); } - (IBAction)btnTakePhotoTouched:(id)sender { NSLog(@"사진 촬영"); if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { // 인스턴스 생성 UIImagePickerController* imagePickerController = [[UIImagePickerController alloc] init]; // 이미지 소스에 카메라를 지정 imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; // 촬영 후에 편집 불가능 imagePickerController.allowsEditing = NO; // 델리게이트를 이 클래스에 지정 imagePickerController.delegate = self; // 시작 } } - (IBAction)btnPhotoDeleteTouched:(id)sender { NSString *msg = @"사진이 삭제 되었습니다."; [[JDFacade facade] alertTitle:@"알림" message: msg completionHander:nil]; } - (IBAction)btnCancelTouched:(id)sender { [super btnCancelTouched:nil]; } @end