aboutsummaryrefslogtreecommitdiff
path: root/foray
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-03-19 13:45:03 +1100
committerNicholas Tay <nick@windblume.net>2022-03-19 13:45:03 +1100
commitf61362258fc9906eec44e8aa3095757f1cb2df45 (patch)
tree0db202e5c93f08b3573119629815f1e7c8a23771 /foray
parent6f2b810e8e11ba5161a539d46248aadbb0add16e (diff)
downloadforayios-f61362258fc9906eec44e8aa3095757f1cb2df45.tar.gz
forayios-f61362258fc9906eec44e8aa3095757f1cb2df45.tar.bz2
forayios-f61362258fc9906eec44e8aa3095757f1cb2df45.zip
Fix selected item not being passed through
Diffstat (limited to '')
-rw-r--r--foray/ForayDetailViewController.swift7
-rw-r--r--foray/ForayTableViewController.swift2
2 files changed, 5 insertions, 4 deletions
diff --git a/foray/ForayDetailViewController.swift b/foray/ForayDetailViewController.swift
index b329774..92abef1 100644
--- a/foray/ForayDetailViewController.swift
+++ b/foray/ForayDetailViewController.swift
@@ -9,8 +9,6 @@ import UIKit
class ForayDetailViewController: UIViewController {
- var selectedItem: PenguinItem!
-
let detailView: ForayNewDetailView = ForayNewDetailView(frame: CGRect.zero)
override func viewDidLoad() {
@@ -19,11 +17,14 @@ class ForayDetailViewController: UIViewController {
self.view.backgroundColor = .systemBackground
- detailView.setSelectedItem(selectedItem: selectedItem)
self.view.addSubview(detailView)
detailView.snp.makeConstraints { (make) in
make.edges.equalTo(self.view.snp.margins)
}
}
+
+ public func setSelectedItem(selectedItem: PenguinItem) {
+ detailView.setSelectedItem(selectedItem: selectedItem)
+ }
}
diff --git a/foray/ForayTableViewController.swift b/foray/ForayTableViewController.swift
index b00fca9..c9e055a 100644
--- a/foray/ForayTableViewController.swift
+++ b/foray/ForayTableViewController.swift
@@ -165,7 +165,7 @@ class ForayTableViewController: UITableViewController {
tableView.deselectRow(at: indexPath, animated: true)
let item = self.sections[indexPath.section].items[indexPath.row]
- detailViewController.selectedItem = item
+ detailViewController.setSelectedItem(selectedItem: item)
self.navigationController?.pushViewController(detailViewController, animated: true)
}