UIQRScanView

public final class UIQRScanView : UIView, AVCaptureMetadataOutputObjectsDelegate

The UIRegistrationQRView enables mobile application to scan a QR code for device registration.

  • Returns an object initialized from data in a given unarchiver.

    Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)

    Parameters

    aDecoder

    An unarchiver object.

  • Draws the receiver’s image within the passed-in rectangle.

    Declaration

    Swift

    override public func draw(_ rect: CGRect)

    Parameters

    rect

    The portion of the view’s bounds that needs to be updated.

  • The outline color when the QR scan is not matached.

    Remark

    Default value is UIColor(red:1.00, green:0.31, blue:0.31, alpha:0.75)

    Declaration

    Swift

    @IBInspectable
    public var scanNoMatchColor: UIColor
  • The outline color when the QR scan is matached.

    Remark

    Default value is UIColor(red:0.25, green:0.47, blue:0.75, alpha:0.75)

    Declaration

    Swift

    @IBInspectable
    public var scanMatchColor: UIColor
  • The width of the QR scan border.

    Remark

    Default value is 3.0.

    Declaration

    Swift

    @IBInspectable
    public var scanOutlineWidth: CGFloat
  • Tells the view that a subview is about to be removed.

    Declaration

    Swift

    override public func willRemoveSubview(_ subview: UIView)

    Parameters

    subview

    The subview that will be removed.

  • Start the camera capture.

    Declaration

    Swift

    public func startCapture()
  • Stop the camera capture.

    Declaration

    Swift

    public func stopCapture()
  • Informs the delegate that the capture output object emitted new metadata objects. The AVCaptureMetadataOutput object emits only metadata objects whose types are included in its metadataObjectTypes property.

    Remark

    The AVMetadataObject is set to an instance generated from QR codes.

    Declaration

    Swift

    public func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection)

    Parameters

    captureOutput

    The AVCaptureMetadataOutput object that captured and emitted the metadata objects.

    metadataObjects

    An array of AVMetadataObject instances representing the newly emitted metadata.

    connection

    The capture connection through which the objects were emitted.