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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -