From d8624dbf8a9111f931802cbb2759ebd009096552 Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Thu, 24 Mar 2022 17:07:51 +1100 Subject: First attempt at Presenter This is admittedly pretty hard for me to wrap my head around, and I'm not even using background threading explicitly yet. Will improve. --- foray/Coordinators/ForayCoordinator.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'foray/Coordinators') diff --git a/foray/Coordinators/ForayCoordinator.swift b/foray/Coordinators/ForayCoordinator.swift index 6497ec0..6c4bb3f 100644 --- a/foray/Coordinators/ForayCoordinator.swift +++ b/foray/Coordinators/ForayCoordinator.swift @@ -33,7 +33,7 @@ class ForayCoordinator: Coordinator { let detailViewController = ForayDetailViewController() - func showDetails(item: PenguinItem) { + func showDetails(item: PenguinItemViewModel) { let image: UIImage var description: String = "Type: " switch item.type { @@ -45,9 +45,7 @@ class ForayCoordinator: Coordinator { image = UIImage(named: "spy")! } description += "\nID: " + item.id - let dateFormatter = DateFormatter() - dateFormatter.dateFormat = "yyyy-MM-dd" - description += "\nReleased: " + dateFormatter.string(from: item.releaseDate) + description += "\nReleased: " + item.releaseDateFormatted detailViewController.setDetails(name: item.name, description: description, image: image) push(vc: detailViewController) -- cgit