Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
Detenemos la grabación
*/
private func stopScreenRecording() -> Void
{
RPScreenRecorder.shared().stopRecording() { (previewController: RPPreviewViewController?, error: Error?) -> Void in
if let error = error
{
print("Error al detener la grabación.")
print(error.localizedDescription)
}
guard let previewController = previewController else
{
return
}
// Preparación para el iPad
if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad
{
previewController.modalPresentationStyle = UIModalPresentationStyle.popover
previewController.popoverPresentationController?.sourceRect = CGRect.zero
previewController.popoverPresentationController?.sourceView = self.buttonRecord
}
previewController.previewControllerDelegate = self
// Mostramos el controlador
self.present(previewController, animated: true, completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.