View in English

  • 메뉴 열기 메뉴 닫기
  • Apple Developer
검색
검색 닫기
  • Apple Developer
  • 뉴스
  • 둘러보기
  • 디자인
  • 개발
  • 배포
  • 지원
  • 계정
페이지에서만 검색

빠른 링크

5 빠른 링크

비디오

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

더 많은 비디오

스트리밍은 대부분의 브라우저와
Developer 앱에서 사용할 수 있습니다.

  • 개요
  • 코드
  • ScreenCaptureKit의 새로운 기능

    ScreenCaptureKit의 최신 기능을 활용해 다양한 방식으로 화면을 공유해 보세요. 내장된 시스템 피커, 프레젠터 오버레이, 스크린샷 기능을 살펴보고, 이 기능들을 기존의 ScreenCaptureKit 앱 및 게임에 통합하는 방법을 알아보세요.

    챕터

    • 0:08 - Intro
    • 1:36 - Presenter Overlay
    • 4:36 - Screen sharing picker
    • 9:46 - Screenshot API
    • 13:01 - Wrap-Up

    리소스

    • ScreenCaptureKit
      • HD 비디오
      • SD 비디오

    관련 비디오

    WWDC23

    • 개인정보 보호의 새로운 기능

    WWDC22

    • 한 차원 높은 ScreenCaptureKit 구현하기
    • ScreenCaptureKit 소개
  • 다운로드
    Array
    • 3:32 - Set up delegate for stream

      // Set up delegate for stream
      let stream = SCStream(filter: filter, configuration: config, delegate: self)
      
      // delegate method for Presenter Overlay applied
      func stream(_ stream: SCStream, outputEffectDidStart didStart: bool) {
          // if Presenter Overlay is on, present banner in app to notify
          if didStart == true {
              presentBanner()
              turnOffCamera()
          } else {
              turnOnCamera()
          }
      }
    • 6:48 - Set up content sharing picker instance

      // Set up content sharing picker instance
          let picker = SCContentSharingPicker.shared()
          picker.addObserver(self)
          picker.active = true
          
          // show system level picker button
          func showSystemPicker(sender: UIButton!) {
              picker.present(for stream: nil, using contentStyle:.window)
          }
          
          // observer call back for picker
          func contentSharingPicker(_ picker: SCContentSharingPicker, didUpdateWith filter:                                          
          SCContentFilter, for stream: SCStream?) {
             if let stream = stream {
                  stream.updateContentFilter(filter)
              } else {
                  let stream = SCStream(filter: filter, configuration: config, delegate: self)
              }
          }
    • 7:41 - Observer call back for picker did fail and did cancel

      // Set up content sharing picker instance
          let picker = SCContentSharingPicker.shared()
          picker.addObserver(self)
          picker.active = true
      
          // show system level picker button
          func showSystemPicker(sender: UIButton!) {
              picker.present(for stream: nil, using contentStyle:.window)
          }
      
          // observer call back for picker did fail
          func contentSharingPicker(contentSharingPickerStartDidFailWith error:NSError) {
              if error {
                  presentNotifications(error: error)
              }
          }
      
          // observer call back for picker did cancel
          func contentSharingPicker(_ picker: SCContentSharingPicker, didCancel for stream: SCStream?) {
             if stream {
                 resetStateForStream(stream: stream)
             }
          }
    • 8:41 - Per-stream configuration

      // Set up content sharing picker instance
          let picker = SCContentSharingPicker.shared()
          picker.addObserver(self)
          picker.active = true
          
          // Create configurations
          let pickerConfig = SCContentSharingPickerConfiguration()
          
          // Set Picker configuration
          pickerConfig.excludedBundleIDs = [“com.foo.myApp”,”com.foo.myApp2”]
          pickerConfig.allowsRepicking = true
          
          // Create configurations
          picker.setConfiguration(pickerConfig, for: stream)
      
          func showSystemPicker(sender: UIButton!) {
              picker.present(for stream: nil, using contentStyle:.window)
          }
    • 12:26 - Call the screenshot API

      // Call the screenshot API
      
      class SCScreenshotManager : NSObject {
      
      class func captureSampleBuffer(contentFilter: SCContentFilter, 
                                     configuration: SCStreamConfiguration)
        															async throws -> CMSampleBuffer
      
      class func captureImage(contentFilter: SCContentFilter,
                              configuration: SCStreamConfiguration)
        											async throws -> GImage
      }
    • 12:44 - Take a screenshot with ScreenCaptureKit

      // Don't forget to customize the content you want in your screenshot
      // Use SCShareableContent or SCContentSharingPicker to pick your content
      let display = nil;
      
      // Create your SCContentFilter and SCStreamConfiguration
      // Customize these lines to use the content you want and desired config options
      let myContentFilter = SCContentFilter(display: display,
                                   excludingApplications: [],
                                   exceptingWindows: []);
      let myConfiguration = SCStreamConfiguration();
      
      // Call the screenshot API and get your screenshot image
      if let screenshot = try? await SCScreenshotManager.captureSampleBuffer(contentFilter: myContentFilter, configuration:
                                                             myConfiguration) {
          print("Fetched screenshot.")
      } else {
          print("Failed to fetch screenshot.")
      }
  • 찾고 계신 콘텐츠가 있나요? 위에 주제를 입력하고 원하는 내용을 바로 검색해 보세요.

    쿼리를 제출하는 중에 오류가 발생했습니다. 인터넷 연결을 확인하고 다시 시도해 주세요.

Developer Footer

  • 비디오
  • WWDC23
  • ScreenCaptureKit의 새로운 기능
  • 메뉴 열기 메뉴 닫기
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    메뉴 열기 메뉴 닫기
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    메뉴 열기 메뉴 닫기
    • 손쉬운 사용
    • 액세서리
    • 앱 확장 프로그램
    • App Store
    • 오디오 및 비디오(영문)
    • 증강 현실
    • 디자인
    • 배포
    • 교육
    • 서체(영문)
    • 게임
    • 건강 및 피트니스
    • 앱 내 구입
    • 현지화
    • 지도 및 위치
    • 머신 러닝
    • 오픈 소스(영문)
    • 보안
    • Safari 및 웹(영문)
    메뉴 열기 메뉴 닫기
    • 문서(영문)
    • 튜토리얼
    • 다운로드(영문)
    • 포럼(영문)
    • 비디오
    메뉴 열기 메뉴 닫기
    • 지원 문서
    • 문의하기
    • 버그 보고
    • 시스템 상태(영문)
    메뉴 열기 메뉴 닫기
    • Apple Developer
    • App Store Connect
    • 인증서, 식별자 및 프로파일(영문)
    • 피드백 지원
    메뉴 열기 메뉴 닫기
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(영문)
    • News Partner Program(영문)
    • Video Partner Program(영문)
    • Security Bounty Program(영문)
    • Security Research Device Program(영문)
    메뉴 열기 메뉴 닫기
    • Apple과의 만남
    • Apple Developer Center
    • App Store 어워드(영문)
    • Apple 디자인 어워드
    • Apple Developer Academy(영문)
    • WWDC
    Apple Developer 앱 받기
    Copyright © 2025 Apple Inc. 모든 권리 보유.
    약관 개인정보 처리방침 계약 및 지침