ios - prepareForSegue compiler error -
i want scan qr code (doing example: http://humberaquino.me/qrcode-scanning-in-swift/), have problem code:
override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { let barcodeviewcontroller: barcodeviewcontroller = segue.destinationviewcontroller as! barcodeviewcontroller barcodeviewcontroller.delegate = self }
i got this:
when change as!
, i'm getting:
thread 1: signal sigabrt on line.
if have more 1 segue on view controller, may 1 firing. checking segue.identifier 1 way of making sure you're on right one. if behaviour based on class can :
if let barcodeviewcontroller = segue.destinationviewcontroller as? barcodeviewcontroller { barcodeviewcontroller.delegate = self }
Comments
Post a Comment