myDate , .
, submitDate, , , , , 'save' segue, , .
@IBAction func submitDate(_ sender: AnyObject) {
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "save" {
if let toViewController = segue.destination as? TableViewController {
toViewController.myDate = DateFormatter.localizedString(from: dateOutlet.date, dateStyle: DateFormatter.Style.none, timeStyle: DateFormatter.Style.short)
}
}
}
var myDate: String!
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = Bundle.main.loadNibNamed("TableViewCell", owner: self, options: nil)?.first as! TableViewCell
cell.textLabel?.text = myDate
return cell
}