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

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -