Level : WORDPRESS BOOK LINKEDIN PATENT Send Mail 동냥하기 hajunho.com

반응형

.zshrc
0.00MB

zshrc

 

have been attached.

 

 

!-- 텍스트 필드 선택시 화면 올리기.

- (void)textFieldDidBeginEditing:(UITextField *)textField {

    if (textField == self.userId) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [UIView setAnimationBeginsFromCurrentState:YES];
        self.view.frame = CGRectMake(self.view.frame.origin.x, (self.view.frame.origin.y - 100), self.view.frame.size.width, self.view.frame.size.height);
        [UIView commitAnimations];
        static_userpw_int = 0;
    }
    else if (textField == self.userPw) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [UIView setAnimationBeginsFromCurrentState:YES];
        self.view.frame = CGRectMake(self.view.frame.origin.x, (self.view.frame.origin.y - 100), self.view.frame.size.width, self.view.frame.size.height);
        [UIView commitAnimations];
        static_userpw_int = 1;
    }
}

- (void)textFieldDidEndEditing:(UITextField *)textField {
    if (textField == self.userId) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [UIView setAnimationBeginsFromCurrentState:YES];
        self.view.frame = CGRectMake(self.view.frame.origin.x, (self.view.frame.origin.y + 100), self.view.frame.size.width, self.view.frame.size.height);
        [UIView commitAnimations];
        static_userpw_int = 0;
    }
    else if (textField == self.userPw) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [UIView setAnimationBeginsFromCurrentState:YES];
        self.view.frame = CGRectMake(self.view.frame.origin.x, (self.view.frame.origin.y + 100), self.view.frame.size.width, self.view.frame.size.height);
        [UIView commitAnimations];
        static_userpw_int = 2;
        [textField resignFirstResponder];
    }
}

- (IBAction)textFieldDoneEditing: (id)sender {

if ([sender tag] == 0) {
}
else {
[sender resignFirstResponder];
}
}








!-- 카메라 diable한 경우 사용자는 화면 까매져도 잘 몰라서 넣는 코드.

#import <AVFoundation/AVFoundation.h>

Adding build phases -> Link binary with libraries -> AVFoundation.framework



AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];

        switch (status){

            case AVAuthorizationStatusAuthorized:{

                    // 동의함

                };

                break;

            

            case AVAuthorizationStatusNotDetermined:{

                    // 정의 안됨 (동의전)

                    [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {

                        if (granted) {

                            //Granted access to mediaType

                            dispatch_async (dispatch_get_main_queue (), ^{



                            });

                        }

                    }];

                };

                break;

            

            case AVAuthorizationStatusDenied:{

                    // 동의안함

                    UIAlertController * alert=   [UIAlertController

                                                  alertControllerWithTitle:@"카메라 접근 요청"

                                                  message:@"카메라 접근 권한이 허용되지 않았습니다.\n'확인' 버튼을 누르시면 접근권한 설정 화면으로 이동합니다."

                                                  preferredStyle:UIAlertControllerStyleAlert];

                

                    UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"확인" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action)

                                               {

                                                   [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]

                                                                                      options:@{}

                                                                            completionHandler:nil];

                                               }];

                    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"취소" style:UIAlertActionStyleDefault handler:nil];

                

                    [alert addAction:okAction];

                    [alert addAction:cancelAction];

                

                    UIViewController *rootView = [[[[UIApplication sharedApplication] delegate] window] rootViewController];

                    while (rootView.presentedViewController) {

                        rootView = rootView.presentedViewController;

                    }

                    [rootView presentViewController:alert animated:YES completion:nil];

                

                }

                break;

            

            case AVAuthorizationStatusRestricted:{

                };

                break;

            

        }

반응형

'살며 생각하며,' 카테고리의 다른 글

개 발 일 지 041  (0) 2019.12.10
개 발 일 지 040  (0) 2019.12.10
개 발 일 지 038  (0) 2019.12.09
개 발 일 지 037  (0) 2019.12.06
개 발 일 지 036  (0) 2019.12.04
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기