0

Hi I have problem when running

pod spec lint

linter is returning such error

 - ERROR | xcodebuild: /UIKit/CollectionViewController.swift:111:37: error: cannot find 'UIHostingConfiguration' in scope
 - 

I don't know why that happens, as I have set in my podspec

  s.swift_version = '5.6'
  s.platform = :ios
  s.ios.deployment_target = '13.0'

and UIHostingConfiguration code is wrapped inside available

@available(iOS 16, *)
    private func makeCell(_ collectionView: UICollectionView, _ indexPath: IndexPath, _ item: Item) -> UICollectionViewCell? {

        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: UICollectionViewCell.reuseIdentifier, for: indexPath)
        cell.contentConfiguration = UIHostingConfiguration { [weak self] in
            self?.content(indexPath, item)
        }
        return cell
    }

SwiftLint also outputs such thing

- Analyzing on iOS 13.0 platform.

Michał Ziobro
  • 10,759
  • 11
  • 88
  • 143
  • Can you provide a [minimal reproducible sample](https://stackoverflow.com/help/minimal-reproducible-example)? What happens when you build your project in Xcode? – Soumya Mahunt Sep 11 '22 at 05:43
  • I've found solution. I have Xcode 13 and Xcode 14 beta. And commend line xcodebuild has wrong version that from Xcode 13. In Xcode Preferences you can change this which xcode should be used as command line tool – Michał Ziobro Sep 11 '22 at 10:19

0 Answers0