mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
fix(ios): decoding with default value is not supported (#1236)
This commit is contained in:
committed by
GitHub
parent
faa89850d0
commit
326df68839
@@ -8,7 +8,7 @@ import UIKit
|
||||
import WebKit
|
||||
|
||||
struct ScanOptions: Decodable {
|
||||
var formats: [SupportedFormat] = []
|
||||
var formats: [SupportedFormat]?
|
||||
let windowed: Bool?
|
||||
let cameraDirection: String?
|
||||
}
|
||||
@@ -241,7 +241,7 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
|
||||
private func runScanner(_ invoke: Invoke, args: ScanOptions) {
|
||||
scanFormats = [AVMetadataObject.ObjectType]()
|
||||
|
||||
args.formats.forEach { format in
|
||||
(args.formats ?? []).forEach { format in
|
||||
scanFormats.append(format.value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user