I want to pass image and other data between UITableViewController
(It have custom UITableViewCell)
. Into the function prepareForSegue
I made following, but it don't work.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "identifierDetail" {
if let index = self.tableView.indexPathForSelectedRow() {
let controller = (segue.destinationViewController as? UINavigationController)?.topViewController as? DetailViewController
let cellIndentifier: String = "NewsCell"
var cell: ParseTableViewCell? = tableView.dequeueReusableCellWithIdentifier(cellIndentifier) as? ParseTableViewCell
controller?.image = cell?.imageViewCell.image
}
}
}