iOS(Objective c) (3) 썸네일형 리스트형 xcode iOS 개발 시 화면 회전에 관한 내용 iOS 개발 시 화면 회전을 시키는 경우가 있다. // 화면 모드 설정 - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskAll; // 옵션 // UIInterfaceOrientationMaskPortrait : 세로 화면만 허용 // UIInterfaceOrientationMaskAll : 전체 화면 허용 // UIInterfaceOrientationMaskPortraitUpsideDown : 거꾸로만 허용 // UIInterfaceOrientationMaskL.. iOS Objectice C 카메라 및 갤러리 권한 허용 iOS Objectice C 카메라 및 갤러리 권한 허용 하기 1. info.plist 에 코드 추가하기 PhotoLibraryUsageDescrition - 갤러리 CameraUsageDescription - 카메라 2. 프로젝트에 라이브러리 추가 프로젝트 > General > Frameworks, Libraries, and Embedded Content 에서 검색해서 추가 3. .m 파일에서 import 시켜주기 #import #import 4. 권한 요청 팝업 띄우기 // 카메라 권한 요청 AVAuthorizationStatus cameraAuthorizationStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; .. Objective c URL로 브라우저 열기 Objective c 에서 URL을 가지고 클릭 시 사파리나 그 외 설정된 브라우저를 여는 방법. NSString *urlString ="https://www.naver.com"; // URL을 열도록 요청 NSURL *url = [NSURL URLWithString:urlString]; if ([[UIApplication sharedApplication] canOpenURL:url]) { [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success){ if (success) { NSLog(@"Opened url"); } }]; } else { // Safari를 열 수 없는 경우 예외 처리 NSLog.. 이전 1 다음