Polish codes of QR code scanner
This commit is contained in:
parent
e4630e950d
commit
6f295be74d
5 changed files with 57 additions and 107 deletions
|
|
@ -37,10 +37,13 @@ class QRScannerController: UIViewController, AVCaptureMetadataOutputObjectsDeleg
|
|||
}
|
||||
|
||||
// Get an instance of the AVCaptureDevice class to initialize a device object and provide the video as the media type parameter.
|
||||
let captureDevice = AVCaptureDevice.default(for: AVMediaType.video)
|
||||
guard let captureDevice = AVCaptureDevice.default(for: .video) else {
|
||||
scannerOutput.text = "CameraAccessDenied.".localize()
|
||||
return
|
||||
}
|
||||
do {
|
||||
// Get an instance of the AVCaptureDeviceInput class using the previous device object.
|
||||
let input = try AVCaptureDeviceInput(device: captureDevice!)
|
||||
let input = try AVCaptureDeviceInput(device: captureDevice)
|
||||
|
||||
// Initialize the captureSession object.
|
||||
captureSession = AVCaptureSession()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue