From 882c6e74e6fe7030906ba21ff7124f0f7c6a626b Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 20 Feb 2017 20:46:10 -0800 Subject: [PATCH] =?UTF-8?q?Adds=20support=20for=20Roxas=E2=80=99=20refacto?= =?UTF-8?q?red=20UITableView/UICollectionView=20data=20source=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Delta/Game Selection/GameCollectionViewController.swift | 3 +-- Delta/Pause Menu/Cheats/CheatsViewController.swift | 2 +- Delta/Pause Menu/PauseMenuViewController.swift | 2 +- Delta/Pause Menu/Save States/SaveStatesViewController.swift | 2 +- .../Controller Skins/ControllerSkinsViewController.swift | 3 +-- External/Roxas | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Delta/Game Selection/GameCollectionViewController.swift b/Delta/Game Selection/GameCollectionViewController.swift index f4b889b..f057612 100644 --- a/Delta/Game Selection/GameCollectionViewController.swift +++ b/Delta/Game Selection/GameCollectionViewController.swift @@ -181,8 +181,7 @@ private extension GameCollectionViewController fetchRequest.sortDescriptors = [NSSortDescriptor(key: #keyPath(Game.name), ascending: true)] self.dataSource = RSTFetchedResultsCollectionViewDataSource(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.shared.viewContext) - self.dataSource.cellIdentifierHandler = { _ in RSTGenericCellIdentifier } - self.dataSource.cellConfigurationHandler = { [unowned self] (cell, indexPath) in + self.dataSource.cellConfigurationHandler = { [unowned self] (cell, item, indexPath) in self.configure(cell as! GridCollectionViewCell, for: indexPath) } } diff --git a/Delta/Pause Menu/Cheats/CheatsViewController.swift b/Delta/Pause Menu/Cheats/CheatsViewController.swift index dd7352e..9c03822 100644 --- a/Delta/Pause Menu/Cheats/CheatsViewController.swift +++ b/Delta/Pause Menu/Cheats/CheatsViewController.swift @@ -180,7 +180,7 @@ extension CheatsViewController override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: RSTGenericCellIdentifier, for: indexPath) + let cell = tableView.dequeueReusableCell(withIdentifier: RSTCellContentGenericCellIdentifier, for: indexPath) self.configure(cell, forIndexPath: indexPath) return cell } diff --git a/Delta/Pause Menu/PauseMenuViewController.swift b/Delta/Pause Menu/PauseMenuViewController.swift index 81276cf..01f236e 100644 --- a/Delta/Pause Menu/PauseMenuViewController.swift +++ b/Delta/Pause Menu/PauseMenuViewController.swift @@ -113,7 +113,7 @@ extension PauseMenuViewController override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RSTGenericCellIdentifier, for: indexPath) as! GridCollectionViewCell + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RSTCellContentGenericCellIdentifier, for: indexPath) as! GridCollectionViewCell self.configureCollectionViewCell(cell, forIndexPath: indexPath) return cell } diff --git a/Delta/Pause Menu/Save States/SaveStatesViewController.swift b/Delta/Pause Menu/Save States/SaveStatesViewController.swift index 7b3d686..26a2c9f 100644 --- a/Delta/Pause Menu/Save States/SaveStatesViewController.swift +++ b/Delta/Pause Menu/Save States/SaveStatesViewController.swift @@ -647,7 +647,7 @@ extension SaveStatesViewController override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RSTGenericCellIdentifier, for: indexPath) as! GridCollectionViewCell + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RSTCellContentGenericCellIdentifier, for: indexPath) as! GridCollectionViewCell self.configureCollectionViewCell(cell, forIndexPath: indexPath) return cell } diff --git a/Delta/Settings/Controller Skins/ControllerSkinsViewController.swift b/Delta/Settings/Controller Skins/ControllerSkinsViewController.swift index 0817199..ed8930a 100644 --- a/Delta/Settings/Controller Skins/ControllerSkinsViewController.swift +++ b/Delta/Settings/Controller Skins/ControllerSkinsViewController.swift @@ -79,8 +79,7 @@ private extension ControllerSkinsViewController let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.shared.viewContext, sectionNameKeyPath: #keyPath(ControllerSkin.name), cacheName: nil) self.dataSource = RSTFetchedResultsTableViewDataSource(fetchedResultsController: fetchedResultsController) - self.dataSource.cellIdentifierHandler = { _ in RSTGenericCellIdentifier } - self.dataSource.cellConfigurationHandler = { [unowned self] (cell, indexPath) in + self.dataSource.cellConfigurationHandler = { [unowned self] (cell, item, indexPath) in self.configure(cell as! ControllerSkinTableViewCell, for: indexPath) } } diff --git a/External/Roxas b/External/Roxas index 784b06e..ecb29e0 160000 --- a/External/Roxas +++ b/External/Roxas @@ -1 +1 @@ -Subproject commit 784b06e1249fae83d42d4bf62bc8350616c1059b +Subproject commit ecb29e0050fe9335845698c896c4cd8ce60df0da