Swift Recorder to record UIView, idea from ASScreenRecorder
pod 'DKRecorder', :git=>'https://github.com/DikeyKing/DKRecorder.git', :tag => '0.1.2'
-
if you can want to record a view, first init a recorder
let recorder = DKRecorder.init() -
then set the destination view you want to record
self.recorder.startRecording() self.recorder.viewToCapture = self.view -
And finish record by calling
self.recorder.stopRecording {url in print("stopRecording url = \(url as Any)") } -
And here is some settings can be changed
self.recorder.recordAudio = false // Make sure NSMicrophoneUsageDescription is added to info.plist when recordAudio is true self.recorder.writeToPhotoLibrary = true // you don't want to save the video to library -
See demo for detail
- Test cases
- Record file Size Optimze