aboutsummaryrefslogtreecommitdiff
path: root/foray/ForayTableViewController.swift
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-03-19 13:14:25 +1100
committerNicholas Tay <nick@windblume.net>2022-03-19 13:14:25 +1100
commit90eb491cb1bee1bd69a5a81cafd6e28d869700fa (patch)
tree2fc84603b54ca23d6bb9c1778a67f605842b3fd7 /foray/ForayTableViewController.swift
parentf19a09c0e91668a48c1958fc9a4fa07f963c4142 (diff)
downloadforayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.tar.gz
forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.tar.bz2
forayios-90eb491cb1bee1bd69a5a81cafd6e28d869700fa.zip
Remove segue, push directly into nav controller
Diffstat (limited to 'foray/ForayTableViewController.swift')
-rw-r--r--foray/ForayTableViewController.swift21
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)
}
}