swift - How do I fix the error "deviceInputWithDevice is unavailable"? -
i'm "upgrading" app swift swift 2 , came across follow error: 'deviceinputwithdevice' unavailable: use object construction 'avcapturedeviceinput(device:error:)'
here code in question:
let capturedevice = avcapturedevice.defaultdevicewithmediatype(avmediatypevideo) var input:avcapturedeviceinput let error:nserror? { let input = try avcapturedeviceinput.deviceinputwithdevice(capturedevice) avcapturedeviceinput } catch let error nserror { print(error) }
can me understand suggested solution: "use object construction 'avcapturedeviceinput(device:error:)'" , how can implement please?
{ let input = try avcapturedeviceinput(device: capturedevice) avcapturedeviceinput // moved rest of image capture do{} scope.
Comments
Post a Comment