What is a scope declaration in swift programming language ?

I'm reading https://docs.swift.org/swift-book/ReferenceManual/Declarations.html the swift reference manual at declarations to learn how to program a scope and still can't find the correct answer to solve these issue.

//

//  ContentView.swift

//  MyMacCamera

//

//  Created by Besleaga Alexandru Marian on 14.06.2021.

//



import SwiftUI



struct ContentView: View {

    var body: some View {

        Text("Hello, world!")

            .padding()

    }

}



struct ContentView_Previews: PreviewProvider {

    static var previews: some View {

        ContentView()

    }

}



class AVCaptureDevice : NSObject {

    func lockForConfiguration() throws {

        

    }

    func unlockForConfiguration(){

        

    }
}



class AVCaptureSession : NSObject {

    func startRunning(){

        

    }

    func stopRunning(){

        

    }

}
class func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus {}
Cannot find type 'AVAuthorizationStatus' in scope

How should I proceed or should I do handle these error ?

You are leaving many of the threads untouched even if you get replies. You should respond to the comments or answers before starting a new question.

Didn't you ask the same question here and get an answer ?

https://developer.apple.com/forums/thread/679685

Did you add

import AVFoundation

May have a look here: h t t p s : / / medium. com/@gaspard.rosay/create-a-camera-app-with-swiftui-60876fcb9118

What is a scope declaration in swift programming language ?
 
 
Q