How to draw camera video as background on IOS using Swift scenekit?
问题 I am trying to develop an augmented reality app using swift and scenekit on ios. Is there a way to draw the video captured by the device camera as a background of the scene? 回答1: This worked for me, I used AVFoundation to capture the video input of the device camera: let captureSession = AVCaptureSession() let previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill if let videoDevice = AVCaptureDevice