What I'm trying to accomplish is to have the bottom half of a screen to be an active qr-code scanner, and the other half of the screen to be a tableview. Whenever I scan a qr-code, it will check the tableview for a match and highlight it.
What would i need to use to make this happen?
I'm using the following cocoapod for the qr code (https://cocoapods.org/pods/QRCodeReader.swift).
This is what my viewcontroller looks like:
import UIKit
import QRCodeReader
class myviewcontroller: UIViewController {
// THIS IS MY UIVIEW VARIABLE FROM STORYBOARD.
@IBOutlet var Uiview: UIView!
override func viewDidLoad()
{
super.viewDidLoad()
}
}
The cocoapods has instructions for how to insert the view, but i have no idea how to apply it (i am very new to uiviews), here is their instructions:
class YourCustomView: UIView, QRCodeReaderDisplayable {
let cameraView: UIView = UIView()
let cancelButton: UIButton? = UIButton()
let switchCameraButton: UIButton? = SwitchCameraButton()
let toggleTorchButton: UIButton? = ToggleTorchButton()
var overlayView: UIView? = UIView()
func setupComponents(with builder: QRCodeReaderViewControllerBuilder) {
// addSubviews
// setup constraints
// etc.
}
}
lazy var reader: QRCodeReaderViewController = {
let builder = QRCodeReaderViewControllerBuilder {
let readerView = QRCodeReaderContainer(displayable: YourCustomView())
$0.readerView = readerView
}
return QRCodeReaderViewController(builder: builder)
}()
Would appreciate any help regarding this!
question from:https://stackoverflow.com/questions/66055457/how-to-apply-barcode-scanner-to-uiview-beginner-level