Created
March 29, 2016 03:31
-
-
Save gfelot/30436d05703b578c6e7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
let indexPath = tableView.indexPathForSelectedRow! | |
let currentCell = tableView.cellForRowAtIndexPath(indexPath) as! BookTableViewCell | |
titleToEdit = currentCell.titleLabel.text! | |
labelToEdit = currentCell.subtitleLabel.text! | |
funcNb = indexPath.row | |
deselectAllRows() | |
performSegueWithIdentifier("editRow", sender: nil) | |
} | |
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
//Set book view controller as delegate to scan book view controller | |
if segue.destinationViewController is ScanBookViewController{ | |
let scanBookViewController:ScanBookViewController = segue.destinationViewController as! ScanBookViewController | |
scanBookViewController.delegate = self | |
} else if segue.identifier == "editRow" { | |
let vc = segue.destinationViewController as! EditionViewController | |
print(titleToEdit) | |
print(labelToEdit) | |
print(funcNb) | |
vc.textEdition.text = "toto" // ICI | |
vc.labelEdition.text = labelToEdit | |
vc.funcNb = funcNb | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment