我创建了一个AVCaptureSession并将前置摄像头连接到它上面
do {
try captureSession.addInput(AVCaptureDeviceInput(device: captureDevice))
}catch{print("err")}
Run Code Online (Sandbox Code Playgroud)
现在我想开始并停止在touche事件上录制.我该怎么做呢?
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
print("touch")
//Start Recording
}
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
print("release");
//End Recording and Save
}
Run Code Online (Sandbox Code Playgroud)