diff options
author | Nicholas Tay <nick@windblume.net> | 2022-03-19 13:14:25 +1100 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2022-03-19 13:14:25 +1100 |
commit | 90eb491cb1bee1bd69a5a81cafd6e28d869700fa (patch) | |
tree | 2fc84603b54ca23d6bb9c1778a67f605842b3fd7 /foray/ForayTableViewController.swift | |
parent | f19a09c0e91668a48c1958fc9a4fa07f963c4142 (diff) | |
download | forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.tar.gz forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.tar.bz2 forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.zip |
Remove segue, push directly into nav controller
Diffstat (limited to '')
-rw-r--r-- | foray/ForayTableViewController.swift | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/foray/ForayTableViewController.swift b/foray/ForayTableViewController.swift index 295e055..a16c3bb 100644 --- a/foray/ForayTableViewController.swift +++ b/foray/ForayTableViewController.swift @@ -158,21 +158,14 @@ class ForayTableViewController: UITableViewController { return "Released in " + dateFormatter.string(from: section.year) } + let detailViewController: ForayDetailViewController = ForayDetailViewController() + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) - performSegue(withIdentifier: "ShowDetailsSegue", sender: indexPath) - } - - // MARK: - Navigation - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "ShowDetailsSegue" { - let indexPath = sender as! IndexPath - let item = self.sections[indexPath.section].items[indexPath.row] - let dvc = segue.destination as! ForayDetailViewController - dvc.selectedItem = item - } else { - fatalError("unreachable") - } + + let item = self.sections[indexPath.section].items[indexPath.row] + detailViewController.selectedItem = item + + self.navigationController?.pushViewController(detailViewController, animated: true) } } |