beginSession() error

Discussion in 'iOS Programming' started by rich1812, Nov 13, 2018.

Tags:
  1. rich1812 macrumors regular

    Joined:
    Oct 4, 2015
    Location:
    earth
    #1
    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.
    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'
                        }
                    }
                }
    
    
     

Share This Page