Sunday, December 15, 2024
HomeiOS Developmentios - Why is the Package deal out of scope in SwiftUI

ios – Why is the Package deal out of scope in SwiftUI


i’m pretty new in swift and have been engaged on a bug the entire day, is perhaps some easy factor i missed,

I’ve been making an attempt to implement QR code scanning function in my app. I used the package deal
“https://github.com/twostraws/CodeScanner”
Which i discovered of a youtube video,

That is my element that ought to render the scanner

import CodeScanner
import SwiftUI

struct QRScannerView: View {
    var physique: some View {
        CodeScannerView(codeTypes: [.qr], simulatedData: "Paul Hudson") { response in
            swap response {
            case .success(let consequence):
                print("Discovered code: (consequence.string)")
            case .failure(let error):
                print("Right here: ",error.localizedDescription)
            }
        }
    }
}

And i’m having the error

Can't discover 'CodeScannerView' in scope

However the factor is, even when i command-click the operate, it takes me to the operate within the package deal. Even with the error, i’m able to run the simulator, since simulators don’t permit for the digicam choice.

However the construct is failing. with the above error.
Please do take a look

I’ve tried:

  1. Cleansing Construct and re-installing
  2. Eliminated and re-installed the package deal
  3. Remoted the operate name, earlier it was in my web page view itself

non of those fastened the error

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments