Instance Method

startCapture(handler:completionHandler:)

Starts screen and audio capture.

Declaration

func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil)

Parameters

captureHandler

A block that is called continuously during screen capture.

sampleBuffer

A CMSampleBuffer 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 Errors for a list of error codes to ReplayKit.

See Also

Controlling App Recording

func startRecording(handler: ((Error?) -> Void)?)

Starts recording the app display.

enum RPSampleBufferType

The type of media clip sample being buffered.

func discardRecording(handler: () -> Void)

Discards the current recording.

func startRecording(withMicrophoneEnabled: Bool, handler: ((Error?) -> Void)?)

Starts recording the app’s audio and video.

Deprecated