我正在开发XCode 6.4.1上的条形码扫描器 这是Swift 2.0代码:
do {
videoInput = try AVCaptureDeviceInput(device: videoCaptureDevice)
} catch {
return
}
你能否告诉我在swift 1.0中替换“do,try& catch”
答案 0 :(得分:1)
if let videoInput = AVCaptureDeviceInput(device: videoCaptureDevice) {
//videoInput available
} else {
return
}