Displays app details when selecting app in MyAppsViewControllers

This commit is contained in:
Riley Testut
2019-05-20 21:40:04 +02:00
parent 3154a86b7a
commit 0c79db4482
2 changed files with 19 additions and 0 deletions

View File

@@ -59,6 +59,12 @@
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="hR3-go-2DG" kind="show" identifier="showAppDetail" id="VNt-zB-flO">
<segue key="commit" inheritsFrom="parent" id="8jj-zE-2hk"/>
<segue key="preview" inheritsFrom="commit" id="9iz-NY-nvu"/>
</segue>
</connections>
</tableViewCell>
</prototypes>
<connections>

View File

@@ -26,6 +26,19 @@ class MyAppsViewController: UITableViewController
self.tableView.dataSource = self.dataSource
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?)
{
guard segue.identifier == "showAppDetail" else { return }
guard let cell = sender as? UITableViewCell, let indexPath = self.tableView.indexPath(for: cell) else { return }
let installedApp = self.dataSource.item(at: indexPath)
guard let app = installedApp.app else { return }
let appDetailViewController = segue.destination as! AppDetailViewController
appDetailViewController.app = app
}
}
private extension MyAppsViewController