aboutsummaryrefslogtreecommitdiff
path: root/foray/ForayTableViewController.swift
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-03-16 10:15:27 +1100
committerNicholas Tay <nick@windblume.net>2022-03-16 10:15:27 +1100
commit5fbe87e25c1136e29494d181edbdbf6d6dbba6e1 (patch)
tree1a8f2f735b586db536ed68e57a3995cc35b629be /foray/ForayTableViewController.swift
parentaa5c132c3bccaf4103c74b95393cd80db79f92f1 (diff)
downloadforayios-5fbe87e25c1136e29494d181edbdbf6d6dbba6e1.tar.gz
forayios-5fbe87e25c1136e29494d181edbdbf6d6dbba6e1.tar.bz2
forayios-5fbe87e25c1136e29494d181edbdbf6d6dbba6e1.zip
Add a detail view
Resources: - https://guides.codepath.com/ios/Using-UITableView (was a bit dated)
Diffstat (limited to 'foray/ForayTableViewController.swift')
-rw-r--r--foray/ForayTableViewController.swift10
1 files changed, 10 insertions, 0 deletions
diff --git a/foray/ForayTableViewController.swift b/foray/ForayTableViewController.swift
index a5c367a..fd4854e 100644
--- a/foray/ForayTableViewController.swift
+++ b/foray/ForayTableViewController.swift
@@ -142,4 +142,14 @@ class ForayTableViewController: UITableViewController {
dateFormatter.dateFormat = "yyyy"
return "Released in " + dateFormatter.string(from: section.year)
}
+
+ // MARK: - Navigation
+
+ override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
+ let indexPath = tableView.indexPathForSelectedRow!
+ let item = self.sections[indexPath.section].items[indexPath.row]
+
+ let dvc = segue.destination as! ForayDetailViewController
+ dvc.selectedItem = item
+ }
}