startRecording(withMicrophoneEnabled:handler:)
Starts recording the app’s audio and video.
Declaration
func startRecording(withMicrophoneEnabled microphoneEnabled: Bool, handler: (((any Error)?) -> Void)? = nil)Parameters
- microphoneEnabled:
Set to True to activate the microphone during the recording. Defaults to False.
- handler:
A block that is called when the request completes.
errorIf 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 specific to ReplayKit.
Discussion
Call startRecording(withMicrophoneEnabled:handler:) on an instance of the recorder to begin recording. When startRecording(withMicrophoneEnabled:handler:) is first called, an alert window appears asking the user to confirm recording. This alert window is also presented if it has been longer than 8 minutes since the last time startRecording(withMicrophoneEnabled:handler:) was called.