yeahdongcn / RSBarcodes_Swift

1D and 2D barcodes reader and generators for iOS 8 with delightful controls. Now Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

barcode handler

mkaya93 opened this issue · comments

Hi,

I have a problem with barcode handler.

Problem is this barcode handler is calling too many time. So I want to push my view when I see barcode. But cause of handler is calling multiple times. App is performing segue multiple time and my app is crashing. How can I solve it ?

self.barcodesHandler = { barcodes in
          if barcodes.count > 0 {
              let barcode = barcodes.first
              if barcode != nil {
                         self.performSegue(withIdentifier: "showDetail", sender: self)
              }
      }

Please use the way provided in the sample.