MLKitBarcodeScanning 框架参考

类型定义

以下类型定义可在全局范围内使用。

  • @enum BarcodeValueType 条形码的值格式。例如:TEXT、PRODUCT、网址 等。

    声明

    Swift

    struct BarcodeValueType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • @enum BarcodeAddressType Address type.

    声明

    Swift

    struct BarcodeAddressType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • @enum BarcodeEmailType BarcodeEmail 的电子邮件类型。

    声明

    Swift

    struct BarcodeEmailType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • @enum BarcodePhoneType BarcodePhone 的电话类型。

    声明

    Swift

    struct BarcodePhoneType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • @enum BarcodeWiFiEncryptionType BarcodeWiFi 的 Wi-Fi 加密类型。

    声明

    Swift

    struct BarcodeWiFiEncryptionType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • 包含条形码数组的块,如果出现错误,则返回 nil

    声明

    Swift

    typealias BarcodeScanningCallback = ([MLKBarcode]?, Error?) -> Void

    参数

    barcodes

    扫描图片中的条形码数组,如果出现错误,则为 nil

    error

    错误或 nil