i'm working on app scans barcode , segues new view controller after scan found. however, if user clicks button (navigation controller, root view controller main menu, [probably] irrelevant), view controller not segue again. segues forward view controller 3 first time app runs, upon hitting "back" , returning vc 2, won't segue vc 3 again. there i'm missing? set handler in viewdidload
:
self.barcodeshandler = { barcodes in if(self.handler_flag) { var barcode = barcodes[0] println("barcode found: type=" + barcode.type + " value=" + barcode.stringvalue) self.bcode = barcode.stringvalue self.handler_flag=false self.performseguewithidentifier("push", sender: nil) } }
and segue:
override public func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { let destinationvc = segue.destinationviewcontroller as! secondviewcontroller destinationvc.settext = bcode }
thanks much!
self.performseguewithidentifier("push", sender: nil)
instead of nil
use self
Comments
Post a Comment