ソースを参照

Nil safe scanning for iOS

flutter-beta
Alexei 6年前
committed by Dominik Spicher
コミット
24e8670753
1個のファイルの変更4行の追加2行の削除
  1. +4
    -2
      ios/Classes/QRView.swift

+ 4
- 2
ios/Classes/QRView.swift ファイルの表示

@@ -26,8 +26,10 @@ public class QRView:NSObject,FlutterPlatformView {
try scanner?.startScanning(resultBlock: { codes in try scanner?.startScanning(resultBlock: { codes in
if let codes = codes { if let codes = codes {
for code in codes { for code in codes {
let stringValue = code.stringValue!
self.channel.invokeMethod("onRecognizeQR", arguments: stringValue)
if (code != nil && code.stringValue != nil) {
let stringValue = code.stringValue!
self.channel.invokeMethod("onRecognizeQR", arguments: stringValue)
}
} }
} }
}) })


読み込み中…
キャンセル
保存