View in English

  • Apple Developer
    • 시작하기

    시작하기 탐색

    • 개요
    • 알아보기
    • Apple Developer Program

    알림 받기

    • 최신 뉴스
    • Hello Developer
    • 플랫폼

    플랫폼 탐색

    • Apple 플랫폼
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    피처링

    • 디자인
    • 배포
    • 게임
    • 액세서리
    • 웹
    • 홈
    • CarPlay
    • 기술

    기술 탐색

    • 개요
    • Xcode
    • Swift
    • SwiftUI

    피처링

    • 손쉬운 사용
    • AI 및 머신러닝
    • 앱 인텐트
    • Apple Intelligence
    • 게임
    • 보안
    • Xcode Cloud
    • 커뮤니티

    커뮤니티 탐색

    • 개요
    • Apple과의 만남 이벤트
    • 커뮤니티 이벤트
    • 개발자 포럼
    • 오픈 소스

    피처링

    • WWDC
    • Swift Student Challenge
    • 개발자 이야기
    • App Store 어워드
    • Apple 디자인 어워드
    • 문서

    문서 탐색

    • 문서 라이브러리
    • 기술 개요
    • 샘플 코드
    • 휴먼 인터페이스 가이드라인
    • 비디오

    릴리즈 노트

    • 피처링 업데이트
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • 다운로드

    다운로드 탐색

    • 모든 다운로드
    • 운영 체제
    • 애플리케이션
    • 디자인 리소스

    피처링

    • Xcode
    • TestFlight
    • 서체
    • SF Symbols
    • Icon Composer
    • 지원

    지원 탐색

    • 개요
    • 도움말
    • 개발자 포럼
    • 피드백 지원
    • 문의하기

    피처링

    • 계정 도움말
    • 앱 심사 지침
    • App Store Connect 도움말
    • 새로 추가될 요구 사항
    • 계약 및 지침
    • 시스템 상태
  • 빠른 링크

    • 이벤트
    • 뉴스
    • 포럼
    • 샘플 코드
    • 비디오
 

비디오

메뉴 열기 메뉴 닫기
  • 컬렉션
  • 전체 비디오
  • 소개

더 많은 비디오

  • 소개
  • 요약
  • 자막 전문
  • 코드
  • Build a great camera experience for iPhone Duo

    Discover how to leverage the outer and inner cameras on iPhone Duo. Explore the Virtual Front Camera, and find out how to use the direction coordinator to switch between cameras and update your UI as people open and close iPhone Duo. Learn best practices for handling preview aspect ratios, positioning, and rotation to deliver a seamless capture experience.

    챕터

    • 0:00 - Introduction
    • 0:31 - Meet the new front cameras
    • 0:58 - Discover the virtual front camera
    • 1:53 - Access each camera individually
    • 2:46 - Track camera direction
    • 4:03 - Create a direction coordinator
    • 4:50 - Use both displays at once
    • 5:38 - Work with device descriptors
    • 6:17 - Handle a direction change
    • 7:03 - Polish your camera preview
    • 8:03 - Handle rotation
    • 8:47 - Next steps

    리소스

      • HD 비디오
      • SD 비디오

    관련 비디오

    WWDC26

    • iOS 앱에서 Center Stage 전면 카메라 지원하기

    Tech Talks

    • Leverage multiple displays and scenes on iPhone Duo
  • 비디오 검색…

    안녕하세요, 저는 타룬(Tarun)입니다. 저는 카메라 소프트웨어 팀 소속입니다. 이 영상에서는 iPhone Duo의 새로운 카메라 기능에 대해 설명하고, 이를 활용해 훌륭한 사용자 경험을 구현하는 방법을 살펴보겠습니다. 먼저 iPhone Duo의 새로운 전면 카메라를 소개하겠습니다. 그 다음에는 사용자가 기기를 열거나 닫을 때 발생하는 카메라 방향 변경을 처리하는 방법을 공유하겠습니다. 마지막으로, iPhone Duo에서 앱의 카메라 미리보기를 더욱 세련되게 다듬을 수 있는 몇 가지 팁을 다룰 예정입니다.

    자, 이제 iPhone Duo의 새로운 전면 카메라를 만나볼 시간입니다. iPhone Duo는 두 개의 전면 카메라를 지원하는 최초의 iPhone입니다. 이 두 카메라 모두 초광각 화각을 가진 정사각형 센서입니다. 기기 외부에는 외부 초광각 카메라가 있습니다. 이 카메라는 환상적인 사진과 동영상을 촬영합니다. 기기를 열면 내부 초광각 카메라( )가 보이는데, 이는 iPhone 최초의 디스플레이 내 카메라입니다.

    앱에서는 AVFoundation을 통해 전면 카메라의 영상을 스트리밍할 수 있습니다. 다른 iPhone과 마찬가지로, AVCaptureDeviceDiscoverySession 디스커버리 세션을 사용하여 전면 카메라를 찾으세요. Wide 또는 Ultra Wide 기기 유형과 함께 position. front를 요청하세요. iPhone Duo에서 이 작업을 수행하면, 앱이 새로운 가상 전면 카메라를 감지하게 됩니다.

    가상 전면 카메라는 외부 및 내부 물리적 카메라 간을 자동으로 전환하는 새로운 AVCaptureDevice입니다. iPhone Duo를 펼친 상태에서는 가상 전면 카메라가 내부 디스플레이의 전면 카메라를 사용합니다.

    iPhone을 접으면 카메라는 자동으로 외부 디스플레이의 전면 카메라로 전환됩니다. 가상 전면 카메라는 앱에 가장 적합한 전면 카메라를 사용합니다. 가상 전면 카메라 는 카메라 전환을 자동으로 처리해 줍니다. 하지만 카메라 방향 변경에 반응하여 더 많은 작업을 수행할 수도 있습니다.

    iPhone Duo의 경우, 각 전면 카메라마다 고유한 AVCaptureDevice 유형이 있습니다. 내장된 외부 초광각 장치 유형 을 사용하여 외부 디스플레이의 전면 카메라에 액세스하세요. 내장된 내부 초광각 장치 유형 을 사용하여 내부 디스플레이의 카메라에 액세스하세요. 이러한 장치 유형을 사용하면, 각 카메라의 모든 기능을 활용할 수 있습니다. 내부 초광각 카메라의 동영상 해상도는 1080p이며 최대 60fps를 지원합니다. 외부 초광각 카메라는 최대 4K 해상도와 120fps를 지원합니다. 앱에서 가상 전면 카메라를 사용할 경우 두 물리적 카메라에 공통된 기능만 이용할 수 있습니다. 즉, 최대 1080p 해상도 와 60fps입니다. 또한 깊이 기능은 개별 카메라에 접근할 때만 지원된다는 점에 유의해야 합니다.

    개별 카메라를 사용할 경우, 사용자가 iPhone Duo를 열거나 닫을 때 카메라 간 전환은 앱에서 처리해야 합니다. 새로운 AVCaptureDeviceDirectionCoordinator API를 사용하여 전환을 관리하세요. 배경 정보를 덧붙이자면, AVCaptureDevice는 항상 고정된 위치 속성을 제공해 왔습니다. iPhone의 경우, 이는 항상 ‘뒤(back)’ 또는 ‘앞(front)’이었습니다. 내부 및 외부 전면 카메라 모두 ‘front’ 값을 가집니다. 하지만 디스플레이가 서로 반대 방향을 향할 수 있는 iPhone Duo에서는 상황이 더 흥미로워집니다. 이는 전면 카메라가 항상 사용자를 향하고 있는 것은 아니라는 것을 의미합니다. 예를 들어, 내부 디스플레이를 보고 있을 때 외부 전면 카메라로 스트리밍할 수 있습니다. 이 경우, 전면 카메라는 사용자를 등지고 있는 상태입니다.

    그리고 앱이 외부 전면 카메라로 스트리밍하는 동안 기기를 닫을 수 있습니다. 그러면 동일한 카메라가 사용자를 직접 향하게 됩니다.

    기기가 열린 상태에서 기기를 뒤집으면, 후면 카메라로 셀카를 찍을 수 있습니다. 이제 앱과 후면 카메라 모두 사용자를 정면으로 향하고 있습니다. 앱이 카메라의 방향을 항상 정확히 파악할 수 있도록 하려면, 방향 코디네이터를 사용하세요. 방향 코디네이터는 앱에 카메라의 위치를 알려주고, 변경 사항이 있을 때마다 최신 정보를 제공합니다.

    방향 코디네이터를 생성하려면 세 가지가 필요합니다: 앱의 UIView, 모니터링할 기기 유형, 그리고 변경 핸들러입니다. 앱의 UIView가 외부 디스플레이에 있을 때, 코디네이터는 외부 디스플레이의 전면 카메라를 ‘전방 카메라’로, 후면 카메라를 ‘후방 카메라’로 표시합니다. 기기를 펼치면, 앱의 UIView가 내부 디스플레이로 이동합니다. 변경 핸들러가 호출되어 외부 전면 및 후면 카메라를 후면 카메라로, 내부 전면 카메라를 전면 카메라로 보고합니다. 기기가 열린 상태에서 기기를 뒤집으면, 카메라 앱을 외부 디스플레이로 이동할 수 있습니다. 이 경우, 후면 카메라와 외부 전면 카메라 모두 전면 카메라로 전환됩니다.

    iPhone Duo에서는 카메라 앱 이 두 디스플레이를 동시에 사용할 수 있습니다. 이는 그룹 화상 통화 나 아이의 사진을 찍으면서 재미있는 것을 보여주는 데 아주 유용합니다. 이 경우 각 디스플레이에 대해 동시에 두 개의 서로 다른 UIView가 생성됩니다. 하나는 외부 디스플레이용 이고, 다른 하나는 내부 디스플레이용입니다. 각 뷰에 대해 별도의 방향 코디네이터를 생성하세요. 외부 디스플레이의 코디네이터는 후면 카메라를 전면 카메라로 보고하는 반면, 내부 디스플레이의 코디네이터 는 이를 후면 카메라로 보고합니다. 각 코디네이터는 자체 뷰를 기준으로 한 위치를 보고합니다. 카메라 앱은 SceneAccessories API를 사용하여 이 기능을 활성화할 수 있습니다. 자세한 내용은 "iPhone Duo에서 여러 디스플레이와 장면 활용하기" 동영상( )에서 확인하세요. 방향 코디네이터는 뷰에 연결되어 있으므로, 메인 액터로만 제한됩니다.

    방향 코디네이터의 변경 처리기(change handler) 는 AVFoundation API를 직접 사용해서는 안 된다는 점을 유의하십시오. 코디네이터는 AVCaptureDevice를 직접 전달하는 대신, AVCaptureDeviceDescriptor를 제공합니다.

    이 디바이스 디스크립터는 메인 액터에서 안전하게 사용할 수 있으며, AVCaptureDevice를 나타내는 전송 가능한 표현입니다.

    여기에는 AVCaptureDevice를 생성하는 데 필요한 모든 정보가 포함되어 있으며, 카메라 액터로 안전하게 전달할 수 있습니다. 이후에는 AVFoundation API를 직접 사용할 수 있습니다.

    변경 핸들러에서 수행해야 할 작업은 다음과 같습니다. 사용자가 기기를 열거나 닫을 때, 변경 핸들러가 호출되어 현재 어떤 카메라가 전면 카메라로 설정되었는지 앱에 알립니다. 이때, AVCaptureSession을 재구성하여 전면 카메라에서 계속 스트리밍되도록 하세요.

    새로운 카메라 방향이 미리보기 미러링 결정에 어떤 영향을 미치는지 고려하세요. 후면 카메라가 전면으로 향할 때는 미리보기를 미러링하여 자연스러운 셀카 카메라 경험을 제공하세요. 마지막으로, 카메라가 변경되는 동안 변경 핸들러를 사용하여 UI 업데이트를 수행하세요. AVKit에서 방향 코디네이터를 찾을 수 있습니다. 코디네이터에 대한 자세한 내용 은 Apple 개발자 문서의 "카메라가 향하는 방향에 따라 카메라 선택하기" 기사( )에서 확인할 수 있습니다.

    카메라 방향 변경에 대해 살펴보았으니, 이제 iPhone Duo에서 앱의 미리보기를 더욱 세련되게 만드는 몇 가지 팁을 소개하겠습니다. 내부 디스플레이에서 후면 카메라의 전체 시야각 을 사용하여 스트리밍할 경우, 미리보기 주변에 추가 디스플레이 공간 이 생깁니다. 이 추가 공간 을 활용하여 미리보기 를 오프셋하면, 남은 공간에 컨트롤을 그룹화할 수 있습니다. 또는 미리보기가 디스플레이 전체를 채우도록 설정할 수도 있습니다. 앱에 적합한 방식을 유연하게 결정할 수 있습니다. AVCaptureVideoPreviewLayer의 videoGravity 속성 을 사용하여 레이어 경계 내 에서 미리보기의 레이아웃을 결정하십시오. AVCaptureDevice 의 dynamicAspectRatio를 사용하여 내부 디스플레이에서 가로 화면 비율을 선택하세요.

    WWDC26의 동영상 "iOS 앱에서 Center Stage 전면 카메라 지원하기" 에서 정사각형 센서의 강력한 기능에 대해 자세히 알아보세요.

    앱에서 회전 처리에 대한 마지막 참고 사항: 회전 코디네이터 를 도입하여 카메라 미리보기 와 사진이 항상 올바른 방향으로 표시되도록 하세요. iPhone Duo에서 앱이 디스플레이를 전환할 때 회전 코디네이터가 를 업데이트합니다. 코디네이터를 사용하여 앱의 회전 가 모든 디스플레이에서 일관되게 적용되도록 하세요. 회전 코디네이터 사용에 대한 자세한 내용은 "카메라 앱에서 기기 회전 지원" 기사를 참조하세요.

    회전 코디네이터를 도입한 후에는 camera-sensor-orientation 보정을 비활성화하여 성능을 개선하세요.

    이 보정 기능은 iPhone Duo의 모든 전면 카메라에서 활성화되어 있습니다. 다음 단계 몇 가지를 안내해 드립니다. iPhone Duo의 기능을 최대한 활용하려면 iOS 27.1 SDK 를 사용하세요.

    기기가 열리거나 닫힐 때 앱에서 카메라 전환 을 어떻게 처리할지 결정하세요. 가상 전면 카메라를 넘어 더 나아가고 싶다면 방향 코디네이터 를 도입하세요. 마지막으로, iPhone Duo에서 앱을 테스트하고 카메라 미리보기가 훌륭하게 표시되는지 확인하세요. 여러분의 카메라 앱이 iPhone Duo에서 어떻게 구현될지 기대됩니다.

    • 3:00 - Understand AVCaptureDevicePosition

      enum AVCaptureDevicePosition: Int {
          case unspecified
          case back
          case front
      }
      
      extension AVCaptureDevice {
          // ...
          var position: AVCaptureDevicePosition { get }
      }
    • 4:06 - Initialize a direction coordinator

      directionCoordinator = AVCaptureDeviceDirectionCoordinator(
          view: view,
          deviceTypes: [
              .builtInOuterUltraWideCamera,
              .builtInInnerUltraWideCamera,
              .builtInDualWideCamera,
          ],
          changeHandler: { [weak self] map in
              self?.updateCameraSession(map)
          }
      )
    • 7:30 - Configure the video preview layer

      class AVCaptureVideoPreviewLayer {
          // ...
      
          var videoGravity: AVLayerVideoGravity { get set }
      }
    • 7:51 - Select a dynamic aspect ratio

      class AVCaptureDevice {
          // ...
      
          var dynamicAspectRatio: AVCaptureDevice.AspectRatio? { get }
      }
    • 8:34 - Disable sensor orientation compensation

      // Disable for improved performance
      class AVCapturePhotoOutput: AVCaptureOutput {
          // ...
      
          var isCameraSensorOrientationCompensationEnabled: Bool { get set }
      }
    • 0:00 - Introduction
    • Tarun from the camera software team introduces the new camera features on iPhone Duo: the new front cameras, handling camera direction changes when people open or close the device, and tips for polishing your app's camera preview.

    • 0:31 - Meet the new front cameras
    • iPhone Duo is the first iPhone with two front cameras, both square sensors with an ultrawide field of view. The outer ultrawide camera sits on the outside of the device, while opening it reveals the inner ultrawide camera — the first under-display camera on iPhone.

    • 0:58 - Discover the virtual front camera
    • Stream from the front cameras through AVFoundation, using AVCaptureDeviceDiscoverySession with position .front and the wide or ultrawide device type. On iPhone Duo this discovers the new virtual front camera, which automatically switches between the inner physical camera when open and the outer one when closed, always using the most relevant camera for your app.

    • 1:53 - Access each camera individually
    • Each front camera has its own AVCaptureDevice type — built-in outer ultrawide and built-in inner ultrawide — giving access to each camera's full capabilities. The inner camera supports 1080p up to 60fps, the outer up to 4K and 120fps. The virtual front camera exposes only features common to both, meaning 1080p and 60fps, and depth is supported only when accessing the individual cameras.

    • 2:46 - Track camera direction
    • When using individual cameras, your app is responsible for switching as people open or close the device — use the new AVCaptureDeviceDirectionCoordinator. AVCaptureDevice's position property has always been back or front, and both front cameras report front, but on iPhone Duo the displays can face opposite directions, so a front camera isn't always looking at you. The coordinator keeps your app up to date on where cameras are facing.

    • 4:03 - Create a direction coordinator
    • A direction coordinator needs three things: your app's UIView, the device types to monitor, and a change handler. When your view is on the outer display, outer front cameras report as forward-facing and rear cameras as backward-facing. Opening the device moves your view to the inner display and calls your change handler, which then reports the inner front camera as forward-facing.

    • 4:50 - Use both displays at once
    • A camera app can use both displays simultaneously — useful for a group video call, or for showing a child something fun while photographing them. With a separate UIView per display, create a separate direction coordinator for each, since each reports positions relative to its own view. Camera apps enable this with the SceneAccessories API, covered in "Leverage multiple displays and scenes on iPhone Duo".

    • 5:38 - Work with device descriptors
    • Because the direction coordinator is tied to a view, it's isolated to the main actor, so your change handler shouldn't use AVFoundation APIs directly. Instead of an AVCaptureDevice, the coordinator provides an AVCaptureDeviceDescriptor — a main-actor-safe, sendable representation containing everything needed to create an AVCaptureDevice, which you can safely pass to your camera actor.

    • 6:17 - Handle a direction change
    • When your change handler is called, reconfigure your AVCaptureSession to keep streaming from the forward-facing camera. Consider how the new direction affects mirroring — mirror the preview when the rear camera is forward-facing for a natural selfie experience — and perform any UI updates your app needs. The direction coordinator is found in AVKit.

    • 7:03 - Polish your camera preview
    • Streaming the rear camera's full field of view on the inner display leaves extra space around the preview: offset the preview to group controls in the remaining space, or let it fill the display. Use videoGravity on AVCaptureVideoPreviewLayer to control layout within the layer bounds. When streaming from the ultrawide front cameras, use dynamicAspectRatio on AVCaptureDevice to select a landscape aspect ratio and fill the display.

    • 8:03 - Handle rotation
    • Adopt AVCaptureDeviceRotationCoordinator to keep your camera preview and photos upright. On iPhone Duo it updates when your app moves between displays, so rotation is applied consistently. After adopting it, disable camera sensor orientation compensation — enabled on all iPhone Duo front cameras — to improve performance.

    • 8:47 - Next steps
    • Use the iOS 27.1 SDK to take full advantage of iPhone Duo, decide how your app will handle switching cameras when the device opens or closes, adopt a direction coordinator if you want to move beyond the virtual front camera, and test that your camera preview looks great.

Developer 바닥글

  • 비디오
  • Tech Talks
  • Build a great camera experience for iPhone Duo
  • 메뉴 열기 메뉴 닫기
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    메뉴 열기 메뉴 닫기
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    메뉴 열기 메뉴 닫기
    • 손쉬운 사용
    • 액세서리
    • AI 및 머신 러닝
    • Apple Intelligence
    • 오디오 및 비디오
    • 증강 현실
    • 비즈니스
    • 디자인
    • 배포
    • 교육
    • 게임
    • 건강 및 피트니스
    • 앱 내 구입
    • 현지화
    • 지도 및 위치
    • 보안
    • Safari 및 웹
    메뉴 열기 메뉴 닫기
    • 문서
    • 다운로드
    • 샘플 코드
    • 비디오
    • 문서 아카이브
    메뉴 열기 메뉴 닫기
    • 도움말 및 문서
    • 문의하기
    • 포럼
    • 피드백 및 버그 리포트
    • 시스템 상태
    메뉴 열기 메뉴 닫기
    • Apple Developer
    • App Store Connect
    • 인증서, ID 및 프로파일
    • 피드백 지원
    메뉴 열기 메뉴 닫기
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    메뉴 열기 메뉴 닫기
    • Apple과의 만남
    • Apple Developer Centers
    • App Store 어워드
    • Apple 디자인 어워드
    • Apple Developer Academy
    • WWDC
    최신 뉴스 읽기 Apple Developer 앱 받기 bilibili, LinkedIn, WeChat, YouTube에서 팔로우하기
    Copyright © 2026 Apple Inc. 모든 권리 보유.
    약관 개인정보 처리방침 계약 및 지침