What's New / Media, Audio & Capture

What's new in ScreenCaptureKit

+72 NewiOS · macOS · tvOS

ScreenCaptureKit captures screen, window, and audio content on Apple platforms. It includes picker UI for choosing what to share and delivers stream output to the app.

72 new APIs, no deprecations or removals. New types include the SCStreamError struct with its Code enum (cases insufficientStorage, notSupported, missingBackgroundMode), the SCRecordingOutputDelegate, SCRecordingEditorDelegate, SCClipBufferingOutputDelegate, and SCContentSharingPickerObserver protocols, and the enums SCShareableContentStyle, SCStreamOutputType, SCFrameStatus, SCCaptureDynamicRange, and Preset. New entry points cover SCContentSharingPicker presentation (present, presentForCurrentApplication, isAvailable), the SCStreamErrorDomain, and the SCStreamFrameInfo struct.

New

72
func

addClipBufferingOutput

NewiOSmacOStvOS
open func addClipBufferingOutput(_ clipBufferingOutput: SCClipBufferingOutput) throws
func

addRecordingOutput

NewiOStvOS
open func addRecordingOutput(_ recordingOutput: SCRecordingOutput) throws
func

addVideoEffectOutput

NewiOS
open func addVideoEffectOutput(_ videoEffectOutput: SCVideoEffectOutput) throws
var

captureDynamicRange

NewiOS
open var captureDynamicRange: SCCaptureDynamicRange
var

capturesAudio

NewiOStvOS
open var capturesAudio: Bool
var

channelCount

NewiOStvOS
open var channelCount: Int
var

contentRect

NewiOStvOS
open var contentRect: CGRect { get }
var

excludesCurrentProcessAudio

NewiOStvOS
open var excludesCurrentProcessAudio: Bool
var

height

NewiOStvOS
open var height: Int
init

init

NewiOS
public convenience init(preset: SCStreamConfiguration.Preset)
var

isAvailable

NewiOSmacOStvOS
open var isAvailable: Bool { get }
var

isCameraEnabled

NewiOSmacOS
open var isCameraEnabled: Bool { get }
var

isCapturing

NewiOSmacOStvOS
open var isCapturing: Bool { get }
var

isMicrophoneEnabled

NewiOSmacOS
open var isMicrophoneEnabled: Bool { get }
var

mixesAudioWithMicrophone

NewiOSmacOStvOS
open var mixesAudioWithMicrophone: Bool
var

pointPixelScale

NewiOStvOS
open var pointPixelScale: Float { get }
func

present

NewiOS
open func present()
func

present

NewiOStvOS
open func present(using contentStyle: SCShareableContentStyle)
func

present

NewiOStvOS
open func present(from windowScene: UIWindowScene, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
func

present

NewiOStvOS
open func present(from windowScene: UIWindowScene) async throws
func

present

NewmacOS
open func present(from window: NSWindow, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
func

present

NewmacOS
open func present(from window: NSWindow) async throws
func

present

NewtvOS
open func present(from windowScene: UIWindowScene, mode: SCRecordingEditor.Mode, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
func

present

NewtvOS
open func present(from windowScene: UIWindowScene, mode: SCRecordingEditor.Mode) async throws
func

presentForCurrentApplication

NewiOStvOS
open func presentForCurrentApplication()
func

removeClipBufferingOutput

NewiOSmacOStvOS
open func removeClipBufferingOutput(_ clipBufferingOutput: SCClipBufferingOutput) throws
func

removeRecordingOutput

NewiOStvOS
open func removeRecordingOutput(_ recordingOutput: SCRecordingOutput) throws
func

removeVideoEffectOutput

NewiOS
open func removeVideoEffectOutput(_ videoEffectOutput: SCVideoEffectOutput) throws
var

sampleRate

NewiOStvOS
open var sampleRate: Int
enum

SCCaptureDynamicRange

NewiOS
public enum SCCaptureDynamicRange : Int, @unchecked Sendable
Declaration
public enum SCCaptureDynamicRange : Int, @unchecked Sendable {

    case SDR = 0

    case hdrCanonicalDisplay = 2
}
protocol

SCClipBufferingOutputDelegate

NewiOSmacOStvOS
public protocol SCClipBufferingOutputDelegate : NSObjectProtocol
Declaration
public protocol SCClipBufferingOutputDelegate : NSObjectProtocol {

    /**
     @abstract clipBufferingOutputDidStartBuffering:
     @param clipBufferingOutput the SCClipBufferingOutput object
     @discussion Notifies the delegate that clip buffering has successfully started.
    */
    optional func clipBufferingOutputDidStartBuffering(_ clipBufferingOutput: SCClipBufferingOutput)

    /**
     @abstract clipBufferingOutput:didFailWithError:
     @param clipBufferingOutput the SCClipBufferingOutput object
     @param error error describing why clip buffering failed
     @discussion Notifies the delegate that clip buffering has failed with an associated error.
    */
    optional func clipBufferingOutput(_ clipBufferingOutput: SCClipBufferingOutput, didFailWithError error: any Error)

    /**
     @abstract clipBufferingOutputDidStopBuffering:
     @param clipBufferingOutput the SCClipBufferingOutput object
     @discussion Notifies the delegate that clip buffering has finished successfully.
    */
    optional func clipBufferingOutputDidStopBuffering(_ clipBufferingOutput: SCClipBufferingOutput)
}
extension

SCContentSharingPicker

NewiOStvOS
extension SCContentSharingPicker
Declaration
extension SCContentSharingPicker {

    public var configuration: SCContentSharingPickerConfiguration?

    public var defaultConfiguration: SCContentSharingPickerConfiguration

    public func setConfiguration(_ configuration: SCContentSharingPickerConfiguration?, for stream: SCStream)
}
struct

SCContentSharingPickerConfiguration

NewiOStvOS
public struct SCContentSharingPickerConfiguration
Declaration
public struct SCContentSharingPickerConfiguration {

    @available(iOS 27.0, *)
    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    @available(tvOS, unavailable)
    public var showsMicrophoneControl: Bool

    @available(iOS 27.0, *)
    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    @available(visionOS, unavailable)
    public var showsCameraControl: Bool

    public init()
}
protocol

SCContentSharingPickerObserver

NewiOStvOS
public protocol SCContentSharingPickerObserver : NSObjectProtocol
Declaration
public protocol SCContentSharingPickerObserver : NSObjectProtocol {

    /**
     @abstract contentSharingPicker:didCancelforStream:
     @param picker the SCContentSharingPicker object
     @param stream the optional associated stream for this picker
     @discussion the observer callback method when the picker has been canceled with no selection.
    */
    func contentSharingPicker(_ picker: SCContentSharingPicker, didCancelFor stream: SCStream?)

    /**
     @abstract contentSharingPicker:didUpdateWithFilter:forStream:
     @param picker the SCContentSharingPicker object
     @param filter the updated filter
     @param stream the updated stream
     @discussion the observer callback method when the user has finished updating content for a stream
    */
    func contentSharingPicker(_ picker: SCContentSharingPicker, didUpdateWith filter: SCContentFilter, for stream: SCStream?)

    /**
     @abstract contentSharingPickerStartDidFailWithError:
     @param error the error denoted for the failure to start picker
     @discussion the observer callback method when the picker was asked to start but failed to do so.
    */
    func contentSharingPickerStartDidFailWithError(_ error: any Error)
}
enum

SCFrameStatus

NewiOStvOS
public enum SCFrameStatus : Int, @unchecked Sendable
Declaration
public enum SCFrameStatus : Int, @unchecked Sendable {

    case complete = 0

    case idle = 1

    case blank = 2

    case suspended = 3

    case started = 4

    case stopped = 5
}
protocol

SCRecordingEditorDelegate

NewiOSmacOStvOS
public protocol SCRecordingEditorDelegate : NSObjectProtocol
Declaration
public protocol SCRecordingEditorDelegate : NSObjectProtocol {

    /**
     @abstract recordingEditorDidDismiss:
     @discussion Called when the recording editor is dismissed.
     */
    optional func recordingEditorDidDismiss(_ editor: SCRecordingEditor)

    /**
     @abstract recordingEditor:didFailWithError:
     @discussion Called when the recording editor encounters an error.
     */
    optional func recordingEditor(_ editor: SCRecordingEditor, didFailWithError error: any Error)
}
protocol

SCRecordingOutputDelegate

NewiOStvOS
public protocol SCRecordingOutputDelegate : NSObjectProtocol
Declaration
public protocol SCRecordingOutputDelegate : NSObjectProtocol {

    /**
     @abstract recordingOutputDidStartRecording:
     @param recordingOutput the SCRecordingOutput object
     @discussion notifies the delegate that recording has succesfully started.
    */
    optional func recordingOutputDidStartRecording(_ recordingOutput: SCRecordingOutput)

    /**
     @abstract recordingOutput:didFailWithError:
     @param recordingOutput the SCRecordingOutput object
     @param error error describing why the recording failed.
     @discussion notifies the delegate that recording has failed with error associated.
    */
    optional func recordingOutput(_ recordingOutput: SCRecordingOutput, didFailWithError error: any Error)

    /**
     @abstract recordingOutputDidFinishRecording:
     @discussion notifies the delegate that recording has finished successfully.
    */
    optional func recordingOutputDidFinishRecording(_ recordingOutput: SCRecordingOutput)
}
enum

SCShareableContentStyle

NewiOStvOS
public enum SCShareableContentStyle : Int, @unchecked Sendable
Declaration
public enum SCShareableContentStyle : Int, @unchecked Sendable {

    case none = 0

    @available(iOS 27.0, *)
    case display = 2
}
protocol

SCStreamDelegate

NewiOStvOS
public protocol SCStreamDelegate : NSObjectProtocol
Declaration
public protocol SCStreamDelegate : NSObjectProtocol {

    /**
     @abstract stream:didStopStreamWithError:
     @param stream the SCStream object
     @param error the error denoted by the stopping of the stream
     @discussion notifies the delegate that the stream has stopped and the error associated with it
    */
    optional func stream(_ stream: SCStream, didStopWithError error: any Error)

    /**
     @abstract outputVideoEffectDidStartForStream:
     @param stream the SCStream object
     @discussion notifies the delegate that the stream's overlay video effect has started.
    */
    @available(iOS 27.0, *)
    optional func outputVideoEffectDidStart(for stream: SCStream)

    /**
     @abstract outputVideoEffectDidStopForStream:
     @param stream the SCStream object
     @discussion notifies the delegate that the stream's overlay video effect has stopped.
    */
    @available(iOS 27.0, *)
    optional func outputVideoEffectDidStop(for stream: SCStream)

    /**
     @abstract outputVideoEffectDidFailForStream:withError:
     @param stream the SCStream object
     @param error the error describing why the video effect failed
     @discussion Notifies the delegate that the video effect failed with an error. This can occur if the camera device is unavailable, permissions are missing, or an internal error occurs.
    */
    @available(iOS 27.0, *)
    optional func outputVideoEffectDidFail(for stream: SCStream, withError error: any Error)

    /**
     @abstract streamDidBecomeActive:
     @param stream the SCStream object
     @discussion notifies the delegate the first time any window that was being shared in the stream is re-opened after all the windows being shared are closed.  When all the windows being shared are closed, the client will receive streamDidBecomeInactive:.
     */
    optional func streamDidBecomeActive(_ stream: SCStream)

    /**
     @abstract streamDidBecomeInactive:
     @param stream the SCStream object
     @discussion notifies the delegate that all the windows that are currently being shared are exited. This callback occurs for all content filter types.
    */
    optional func streamDidBecomeInactive(_ stream: SCStream)
}
struct

SCStreamError

NewiOStvOS
public struct SCStreamError : CustomNSError, Hashable, Error
Declaration
public struct SCStreamError : CustomNSError, Hashable, Error {

    public init(_nsError: NSError)

    public static var errorDomain: String { get }

    @available(iOS 27.0, *)
    public enum Code : Int, @unchecked Sendable, Equatable {

        public typealias _ErrorType = SCStreamError

        case userDeclined = -3801

        case failedToStart = -3802

        case missingEntitlements = -3803

        case failedApplicationConnectionInvalid = -3804

        case failedApplicationConnectionInterrupted = -3805

        case failedNoMatchingApplicationContext = -3806

        case attemptToStartStreamState = -3807

        case attemptToStopStreamState = -3808

        case attemptToUpdateFilterState = -3809

        case attemptToConfigState = -3810

        case internalError = -3811

        case invalidParameter = -3812

        case noWindowList = -3813

        case noDisplayList = -3814

        case noCaptureSource = -3815

        case removingStream = -3816

        case userStopped = -3817

        case failedToStartAudioCapture = -3818

        case failedToStopAudioCapture = -3819

        case failedToStartMicrophoneCapture = -3820

        case systemStoppedStream = -3821

        @available(iOS 27.0, *)
        case insufficientStorage = -3822

        @available(iOS 27.0, *)
        case notSupported = -3823

        @available(iOS 27.0, *)
        case missingBackgroundMode = -3824
    }

    public static var userDeclined: SCStreamError.Code { get }

    public static var failedToStart: SCStreamError.Code { get }

    public static var missingEntitlements: SCStreamError.Code { get }

    public static var failedApplicationConnectionInvalid: SCStreamError.Code { get }

    public static var failedApplicationConnectionInterrupted: SCStreamError.Code { get }

    public static var failedNoMatchingApplicationContext: SCStreamError.Code { get }

    public static var attemptToStartStreamState: SCStreamError.Code { get }

    public static var attemptToStopStreamState: SCStreamError.Code { get }

    public static var attemptToUpdateFilterState: SCStreamError.Code { get }

Truncated.

let

SCStreamErrorDomain

NewiOStvOS
public let SCStreamErrorDomain: String
struct

SCStreamFrameInfo

NewiOStvOS
public struct SCStreamFrameInfo : Hashable, Equatable, RawRepresentable, @unchecked Sendable
Declaration
public struct SCStreamFrameInfo : Hashable, Equatable, RawRepresentable, @unchecked Sendable {

    public init(rawValue: String)
}
protocol

SCStreamOutput

NewiOStvOS
public protocol SCStreamOutput : NSObjectProtocol
Declaration
public protocol SCStreamOutput : NSObjectProtocol {

    /**
     @abstract stream:didOutputSampleBuffer:ofType:
     @param sampleBuffer the sample buffer
     @param type the sample buffer type
     @discussion protocol method for passing back screen sample buffers
    */
    optional func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of type: SCStreamOutputType)
}
enum

SCStreamOutputType

NewiOStvOS
public enum SCStreamOutputType : Int, @unchecked Sendable
Declaration
public enum SCStreamOutputType : Int, @unchecked Sendable {

    case screen = 0

    @available(iOS 27.0, *)
    case audio = 1

    @available(iOS 27.0, *)
    case microphone = 2
}
var

style

NewiOStvOS
open var style: SCShareableContentStyle { get }
var

synchronizationClock

NewiOStvOS
open var synchronizationClock: CMClock? { get }
var

width

NewiOStvOS
open var width: Int
var

SCContentSharingPickerConfiguration.showsCameraControl

NewiOS
public var showsCameraControl: Bool
var

SCContentSharingPickerConfiguration.showsMicrophoneControl

NewiOS
public var showsMicrophoneControl: Bool
enum

SCRecordingEditor.Mode

NewtvOS
public enum Mode : Int, @unchecked Sendable
Declaration
public enum Mode : Int, @unchecked Sendable {

    case preview = 0

    case share = 1
}
case

SCShareableContentStyle.display

NewiOS
case display = 2
enum

SCStreamConfiguration.Preset

NewiOS
public enum Preset : Int, @unchecked Sendable
Declaration
public enum Preset : Int, @unchecked Sendable {

    @available(iOS 27.0, *)
    case captureHDRRecordingPreservedSDRHDR10 = 4
}
case

SCStreamConfiguration.Preset.captureHDRRecordingPreservedSDRHDR10

NewiOS
case captureHDRRecordingPreservedSDRHDR10 = 4
func

SCStreamDelegate.outputVideoEffectDidFail

NewiOS
optional func outputVideoEffectDidFail(for stream: SCStream, withError error: any Error)
func

SCStreamDelegate.outputVideoEffectDidStart

NewiOStvOS
optional func outputVideoEffectDidStart(for stream: SCStream)
func

SCStreamDelegate.outputVideoEffectDidStop

NewiOStvOS
optional func outputVideoEffectDidStop(for stream: SCStream)
enum

SCStreamError.Code

NewiOStvOS
public enum Code : Int, @unchecked Sendable, Equatable
Declaration
public enum Code : Int, @unchecked Sendable, Equatable {

    public typealias _ErrorType = SCStreamError

    case userDeclined = -3801

    case failedToStart = -3802

    case missingEntitlements = -3803

    case failedApplicationConnectionInvalid = -3804

    case failedApplicationConnectionInterrupted = -3805

    case failedNoMatchingApplicationContext = -3806

    case attemptToStartStreamState = -3807

    case attemptToStopStreamState = -3808

    case attemptToUpdateFilterState = -3809

    case attemptToConfigState = -3810

    case internalError = -3811

    case invalidParameter = -3812

    case noWindowList = -3813

    case noDisplayList = -3814

    case noCaptureSource = -3815

    case removingStream = -3816

    case userStopped = -3817

    case failedToStartAudioCapture = -3818

    case failedToStopAudioCapture = -3819

    case failedToStartMicrophoneCapture = -3820

    case systemStoppedStream = -3821

    @available(iOS 27.0, *)
    case insufficientStorage = -3822

    @available(iOS 27.0, *)
    case notSupported = -3823

    @available(iOS 27.0, *)
    case missingBackgroundMode = -3824
}
var

SCStreamError.insufficientStorage

NewiOSmacOStvOS
public static var insufficientStorage: SCStreamError.Code { get }
var

SCStreamError.missingBackgroundMode

NewiOSmacOStvOS
public static var missingBackgroundMode: SCStreamError.Code { get }
var

SCStreamError.notSupported

NewiOSmacOStvOS
public static var notSupported: SCStreamError.Code { get }
case

SCStreamError.Code.insufficientStorage

NewiOSmacOStvOS
case insufficientStorage = -3822
case

SCStreamError.Code.missingBackgroundMode

NewiOSmacOStvOS
case missingBackgroundMode = -3824
case

SCStreamError.Code.notSupported

NewiOSmacOStvOS
case notSupported = -3823
let

SCStreamFrameInfo.contentRect

NewiOStvOS
public static let contentRect: SCStreamFrameInfo
let

SCStreamFrameInfo.contentScale

NewiOStvOS
public static let contentScale: SCStreamFrameInfo
let

SCStreamFrameInfo.displayTime

NewiOStvOS
public static let displayTime: SCStreamFrameInfo
let

SCStreamFrameInfo.scaleFactor

NewiOStvOS
public static let scaleFactor: SCStreamFrameInfo
let

SCStreamFrameInfo.screenRect

NewiOStvOS
public static let screenRect: SCStreamFrameInfo
let

SCStreamFrameInfo.status

NewiOStvOS
public static let status: SCStreamFrameInfo
let

SCStreamFrameInfo.videoOrientation

NewiOSmacOS
public static let videoOrientation: SCStreamFrameInfo
case

SCStreamOutputType.audio

NewiOStvOS
case audio = 1
case

SCStreamOutputType.microphone

NewiOS
case microphone = 2

No APIs match your filter.

← More in Media, Audio & Capture