Here is the table view:
public func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary
let too: AnyObject = rowData ["time"] as NSString
var name: String = rowData["time"] as String
var formattedPrice: String = rowData["date"] as String
var alert: UIAlertView = UIAlertView()
alert.title = name
alert.message = formattedPrice
alert.addButtonWithTitle("Ok")
alert.show()
println ("hi")
println (too)
}
I need to reference these variables in another view controller. I have not been able to fit that statement above in this:
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
if (segue.identifier == "segueTest") {
var svc = segue!.destinationViewController as secondViewController;
svc.toPass = textField.text
}
}
I am trying to segue off cell click. from http://jamesleist.com/ios-swift-passing-data-between-viewcontrollers/