From 241b67744569de1d96012669d8170e513473ccc8 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 31 Jul 2019 13:37:51 -0700 Subject: [PATCH] [AltStore] Fixes incorrect app updates section header --- AltStore/My Apps/MyAppsViewController.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index db3a0a31..f6c1980a 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -567,8 +567,12 @@ extension MyAppsViewController { override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { - if indexPath.section == 0 + let section = Section(rawValue: indexPath.section)! + + switch section { + case .noUpdates: return UICollectionReusableView() + case .updates: let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "UpdatesHeader", for: indexPath) as! UpdatesCollectionHeaderView UIView.performWithoutAnimation { @@ -593,9 +597,8 @@ extension MyAppsViewController } return headerView - } - else - { + + case .installedApps: let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "InstalledAppsHeader", for: indexPath) as! InstalledAppsCollectionHeaderView UIView.performWithoutAnimation {