Hi, I am new to this swift thing, I study a piece of downloaded code, when I try to run it, it gives me an error,
"Use of unresolved identifier 'beginSession'" at the top of the code, I imported UIKit and imported AVFoundation. is there anything else I need to import? Thanks.
BTW I use xcode 9.4.1.
"Use of unresolved identifier 'beginSession'" at the top of the code, I imported UIKit and imported AVFoundation. is there anything else I need to import? Thanks.
BTW I use xcode 9.4.1.
Code:
/ Loop through all the capture devices on this phone
for device in devices {
// Make sure this particular device supports video
if (device.hasMediaType(AVMediaTypeVideo)) {
// Finally check the position and confirm we've got the back camera
if(device.position == AVCaptureDevicePosition.Back) {
captureDevice = device as? AVCaptureDevice
if captureDevice != nil {
println("Capture device found")
beginSession() ! Use of unresolved identifier 'beginSession'
}
}
}