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

@@ -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