From 2ac814cd4e13d344620b693a147ccffdd7f5d5af Mon Sep 17 00:00:00 2001 From: James Magahern Date: Mon, 29 Nov 2021 10:56:14 -1000 Subject: [PATCH] Fix build failure for newer iOS --- App/Settings/GeneralSettingsViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/App/Settings/GeneralSettingsViewController.swift b/App/Settings/GeneralSettingsViewController.swift index 0c4339d..96e65c2 100644 --- a/App/Settings/GeneralSettingsViewController.swift +++ b/App/Settings/GeneralSettingsViewController.swift @@ -66,7 +66,7 @@ class GeneralSettingsViewController: UIViewController let collectionView: UICollectionView static func createLayout(forIdiom idiom: UIUserInterfaceIdiom) -> UICollectionViewLayout { - if idiom == .mac { + #if targetEnvironment(macCatalyst) let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0)) let item = NSCollectionLayoutItem(layoutSize: itemSize) @@ -98,11 +98,11 @@ class GeneralSettingsViewController: UIViewController let layout = UICollectionViewCompositionalLayout(section: section) return layout - } else { + #else var listConfiguration = UICollectionLayoutListConfiguration(appearance: .insetGrouped) listConfiguration.headerMode = .supplementary return UICollectionViewCompositionalLayout.list(using: listConfiguration) - } + #endif } static func sectionHeaderConfiguration(forIdiom idiom: UIUserInterfaceIdiom, sectionName: String) -> UIContentConfiguration {