I'm hoping i'm missing something pretty simple here, but I can't seem to get my head around it!
I am reading a QR code and pushing to my next view controller once the QR code has been read:
if metadataObj.stringValue != nil {
let qrData = metadataObj.stringValue
let segueViewController = self.storyboard?.instantiateViewControllerWithIdentifier("confirmScan") as? ScanConfirm
self.navigationController?.pushViewController(segueViewController!, animated: true)
captureSession?.stopRunning() }
I would then like to pass the data found in the QR code and show it in my next view's label. I have tried using prepareForSegue but this doesn't seem to be working.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let NextViewController : ScanConfirm = segue.destinationViewController as! ScanConfirm
NextViewController.newLabel.text = qrData
}
Any help would be HUGELY appreciated!
Thanks