Contents

startCapture(handler:completionHandler:)

Starts screen and audio capture.

Declaration

func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, (any Error)?) -> Void)?, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, (any Error)?) -> Void)?) async throws

Parameters

  • captureHandler:

    A block that is called continuously during screen capture.

    sampleBuffer

    A Cmsamplebuffer Api object containing either audio or video data.

    bufferType

    An Rpsamplebuffertype identifying the media type of the recorded sample.

    error

    Contains an error code if screen capture failed to start. Otherwise, the value of this parameter is nil.

  • completionHandler:

    A block that is called when screen capture has started.

    error

    If an error occurred, this parameter holds an object that explains the error. Otherwise, the value of this parameter is nil. See Rprecordingerrorcode for a list of error codes to ReplayKit.

Discussion

See Also

Controlling App Recording