diff options
author | Nicholas Tay <nick@windblume.net> | 2022-03-19 13:45:03 +1100 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2022-03-19 13:45:03 +1100 |
commit | f61362258fc9906eec44e8aa3095757f1cb2df45 (patch) | |
tree | 0db202e5c93f08b3573119629815f1e7c8a23771 | |
parent | 6f2b810e8e11ba5161a539d46248aadbb0add16e (diff) | |
download | forayios-f61362258fc9906eec44e8aa3095757f1cb2df45.tar.gz forayios-f61362258fc9906eec44e8aa3095757f1cb2df45.tar.bz2 forayios-f61362258fc9906eec44e8aa3095757f1cb2df45.zip |
Fix selected item not being passed through
-rw-r--r-- | foray/ForayDetailViewController.swift | 7 | ||||
-rw-r--r-- | foray/ForayTableViewController.swift | 2 |
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) } |