From 5e753855a36f444004c66ed2fde1cc5647797cf9 Mon Sep 17 00:00:00 2001 From: Magesh K <47920326+mahee96@users.noreply.github.com> Date: Wed, 25 Dec 2024 19:35:07 +0530 Subject: [PATCH] [View]: Fix: temporarily use hardcoded values for headerSize since double dequeue is strictly disallowed --- AltStore/App IDs/AppIDsViewController.swift | 18 +++++++++++------- AltStore/My Apps/MyAppsViewController.swift | 16 ++++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/AltStore/App IDs/AppIDsViewController.swift b/AltStore/App IDs/AppIDsViewController.swift index 4d4f03b8..23e0ab90 100644 --- a/AltStore/App IDs/AppIDsViewController.swift +++ b/AltStore/App IDs/AppIDsViewController.swift @@ -184,14 +184,18 @@ extension AppIDsViewController: UICollectionViewDelegateFlowLayout func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { - let indexPath = IndexPath(row: 0, section: section) - let headerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: indexPath) + // let indexPath = IndexPath(row: 0, section: section) + // let headerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: indexPath) - // Use this view to calculate the optimal size based on the collection view's width - let size = headerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingCompressedSize.height), - withHorizontalFittingPriority: .required, // Width is fixed - verticalFittingPriority: .fittingSizeLevel) // Height can be as large as needed - return size + // // Use this view to calculate the optimal size based on the collection view's width + // let size = headerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingCompressedSize.height), + // withHorizontalFittingPriority: .required, // Width is fixed + // verticalFittingPriority: .fittingSizeLevel) // Height can be as large as needed + // return size + + // NOTE: double dequeue of cell has been discontinued + // TODO: Using harcoded value until this is fixed + return CGSize(width: collectionView.bounds.width, height: 260) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 0dd1b8a1..7f7f2948 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -2061,13 +2061,17 @@ extension MyAppsViewController: UICollectionViewDelegateFlowLayout { guard let _ = DatabaseManager.shared.activeTeam() else { return .zero } - let indexPath = IndexPath(row: 0, section: section.rawValue) - let footerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionFooter, at: indexPath) as! InstalledAppsCollectionFooterView + // let indexPath = IndexPath(row: 0, section: section.rawValue) + // let footerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionFooter, at: indexPath) as! InstalledAppsCollectionFooterView - let size = footerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingExpandedSize.height), - withHorizontalFittingPriority: .required, - verticalFittingPriority: .fittingSizeLevel) - return size + // let size = footerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingExpandedSize.height), + // withHorizontalFittingPriority: .required, + // verticalFittingPriority: .fittingSizeLevel) + // return size + + // NOTE: double dequeue of cell has been discontinued + // TODO: Using harcoded value until this is fixed + return CGSize(width: collectionView.bounds.width, height: 60.5) } switch section