QRCodeReader
public class QRCodeReader : NSObject, AVCaptureMetadataOutputObjectsDelegate
                This class can be used to conveniently read QR codes from the integrated
camera of the device. By default the first QR code detected is returned as a
string. If manualSelection is enabled, the user can choose one of the
visible QR codes manually.
The user is given indication how to enable permissions is denied or
restricted.
- 
                  
                  
This enum indicates possible errors that can occur during capturing a QR code.
See moreDeclaration
Swift
public enum Error : Swift.Error - 
                  
                  
This is a convenience type for the callback that is executed if the scan did finish.
Declaration
Swift
public typealias FinishedScan = (String?) -> Void - 
                  
                  
This sets the color of the text of the Cancel button.
Note
This needs to be set before callingstartScaning.Declaration
Swift
public var cancelButtonTextColor: UIColor? - 
                  
                  
This sets the background color of the Cancel button.
Note
This needs to be set before callingstartScaning.Declaration
Swift
public var cancelButtonBackgroundColor: UIColor - 
                  
                  
This sets the height of the Cancel button.
Note
This needs to be set before callingstartScaning.Declaration
Swift
public var cancelButtonHeight: CGFloat - 
                  
                  
This sets the margin around the Cancel button.
Note
This needs to be set before callingstartScaning.Declaration
Swift
public var cancelButtonMargin: CGFloat - 
                  
                  
This enables vibrating the device or blinking the screen (if vibration is not supported) upon successful detection of a QR code.
Declaration
Swift
public var feedbackOnSuccess: Bool - 
                  
                  
This enables the possibility to select one of the visible QR codes manually. If this is disabled, the scan will automatically finish and select the first QR code detected.
Declaration
Swift
public var manualSelection: Bool - 
                  
                  
Upon deinitalization the scan is aborted.
Declaration
Swift
deinit - 
                  
                  
Aborts a current scan.
Declaration
Swift
@objc public func stopScanning() - 
                  
                  
Starts scanning for a QR code.
This will activate the default camera, which is the camera on the backside of the iOS device. The user will be asked to grant permissions if this did not happen already. If the user previously had denied access to the camera or access is restricted on the device in general instructions for enabling the camere will be provided to the user.
Note
You need to set the
NSCameraUsageDescriptionin yourInfo.plistelse the application will crash when trying to access the camera.Precondition
You must not call this method until a previous scan has finished.
Declaration
Swift
public func startScanning(_ finishedScan: @escaping FinishedScan) throwsParameters
finishedScanA callback that is invoked once the scan has finished. The argument will be the QR code if that was detected successfully,
nilelse, i.e., if the user canceled the scan. 
- 
                  
                  
See
AVCaptureMetadataOutputObjectsDelegateDeclaration
Swift
public func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) 
            View on GitHub
          
      QRCodeReader Class Reference