diff options
-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) } |