With the following code I'm getting this error:
Cannot convert value of type 'inout NSError?' (aka 'inout Optional') to expected argument type '()'
and it's on this line of code:
if device.lockForConfiguration(&error)
Here's the rest of the code:
func focusWithMode(focusMode:AVCaptureFocusMode, exposureMode:AVCaptureExposureMode, point:CGPoint, monitorSubjectAreaChange:Bool){
dispatch_async(self.sessionQueue!, {
var device: AVCaptureDevice! = self.videoDeviceInput!.device
var error: NSError? = nil
if device.lockForConfiguration(&error){
if device.focusPointOfInterestSupported && device.isFocusModeSupported(focusMode){
device.focusMode = focusMode
device.focusPointOfInterest = point
}
if device.exposurePointOfInterestSupported && device.isExposureModeSupported(exposureMode){
device.exposurePointOfInterest = point
device.exposureMode = exposureMode
}
device.subjectAreaChangeMonitoringEnabled = monitorSubjectAreaChange
device.unlockForConfiguration()
}
})
}