У меня есть табличное представление, которое использует пользовательские ячейки. Проблема в том, что я не знаю, как передать значение textField в моей настраиваемой ячейке на следующий контроллер представления с помощью prepareForSegue. Код, который я использую:Проблема с передачей пользовательского значения ячейки в новый viewController в swift
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject) -> PFTableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("StaffCell") as StaffCustomCell!
if cell == nil {
cell = StaffCustomCell(style: UITableViewCellStyle.Default, reuseIdentifier: "StaffCell")
}
// Extract values from the PFObject to display in the table cell
cell?.staffNic?.text = object["Nic"] as String!
cell?.staffApellido?.text = object["Apellido"] as String!
var initialThumbnail = UIImage(named: "iboAzul")
cell.staffFoto.image = initialThumbnail
if let thumbnail = object["FotoStaff"] as? PFFile {
cell.staffFoto.file = thumbnail
cell.staffFoto.loadInBackground()
}
return cell
}
// Pass the custom cell value to the next view controller
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "segueStaffSeleccionado" {
let detailViewController = segue.destinationViewController.visibleViewController as StaffDetailViewController
// This is the code I have no idea how to write. I need to get a value from the selected customCell
}
Любые идеи? Большое спасибо
Второе решение сделало трюк. Большое спасибо. Очень ценю вашу помощь –