现在可以在iOS 11上录制屏幕吗?

Dal*_*vik 7 swift3 ios11

今天我看到一些视频,苹果提供了在控制中心录制屏幕的选项.

我很好奇它是否也可供开发人员使用?

我用谷歌搜索,但没有找到任何与此相关的文档.有人可以对这个话题有所了解.

Cod*_*ger 10

根据API文档中的新更新,您只能通过应用程序捕获屏幕的视频和音频.

在此输入图像描述

RPScreenRecorder:共享记录器对象,提供记录应用程序的音频和视频的功能.

通过本课程,您可以录制您的应用程序屏幕,并通过iPhone麦克风绑定Audion.

以下是一些可用于记录具有不同不同选项的屏幕的方法.

访问共享记录器:

class func shared()
Run Code Online (Sandbox Code Playgroud)

控制应用程序录制:

-- Starts recording the app display.
func startRecording(handler: ((Error?) -> Void)? = nil)

-- Stops the current recording.
func stopRecording(handler: ((RPPreviewViewController?, Error?) -> Void)? = nil)

-- Starts screen and audio capture.
func startCapture(handler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil)

-- Stops screen capture
func stopCapture(handler: ((Error?) -> Void)? = nil)
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助您捕捉应用中的屏幕.

参考链接:https://developer.apple.com/documentation/replaykit/rpscreenrecorder

Doc Ref:https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS_11_0.html

  • 是的IOS 11他们在控制中心添加了屏幕录制功能,但那是私有API,不幸的是我们无法访问我们的应用程序外:( (2认同)