Explorar el Código

Nil safe scanning for iOS

flutter-beta
Alexei hace 6 años
committed by Dominik Spicher
padre
commit
24e8670753
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. +4
    -2
      ios/Classes/QRView.swift

+ 4
- 2
ios/Classes/QRView.swift Ver fichero

@@ -26,8 +26,10 @@ public class QRView:NSObject,FlutterPlatformView {
try scanner?.startScanning(resultBlock: { codes in
if let codes = 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)
}
}
}
})


Cargando…
Cancelar
Guardar