LiveCameraSwiftUI
LiveCameraSwiftUI copied to clipboard
Errors in FrameHandler.swift
I am getting errors in some lines in FrameHandler. Could you help me the following errors?
-
@Published var frame = CGImage?
I am getting the error:Expected member name or constructor call after type name Add arguments after the type to construct a value of the type Use '.self' to reference the type object
-
override init(){ sessionQueue.async { [unowned self] in self.setUpCaptureSession() self.captureSession.startRunning() } }
I am getting the error: async' call in a function that does not support concurrency -
DispatchQueue.main.async { [unowned self] in self.frame = cgImage }
I am getting the error: Cannot assign value of type 'CGImage' to type 'CGImage?.Type'.
You can see my code here https://gist.github.com/oserifogullari18/5fe31d3c55b0e92ef05d5b5beba1e09d. Thank you!