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:

error

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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -