【发布时间】:2015-09-30 23:26:30
【问题描述】:
我正在按照本教程制作相机应用程序,但本教程是用 Swift 编写的,我使用的是 Xcode 7 beta 和 Swift2。
http://jamesonquave.com/blog/taking-control-of-the-iphone-camera-in-ios-8-with-swift-part-1/
听说现在Swift2有不同的错误处理方法,所以我想这部分代码需要改一下。但我不确定如何。谁能帮我这个?谢谢!
var err : NSError? = nil
captureSession.addInput(AVCaptureDeviceInput(device: captureDevice, error: &err))
if err != nil {
println("error: \(err?.localizedDescription)")
}
【问题讨论】:
-
我很难从您提供的链接@Kevin 中推断出答案。您能否为给定的示例提供明确的答案?谢谢
标签: ios avfoundation device avcapturesession swift2