Use of unresolved identifier 'UICollectionLayoutListConfiguration'

I just found this "Use of unresolved identifier ‘UICollectionLayoutListConfiguration’" problem, it should be a standard way to construct the layout configuration, here is my code:

lazy var collectionView: UICollectionView = {          //this is where to alert use of unresolved identifier     let configuration = UICollectionLayoutListConfiguration(appearance: .insetGrouped)          let layout = UICollectionViewCompositionalLayout.list(using: configuration)          let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)          collectionView.translatesAutoresizingMaskIntoConstraints = false     collectionView.backgroundColor = .systemGroupedBackground          return collectionView }() 

can you please help? thanks

Add Comment
1 Answer(s)

UICollectionLayoutListConfiguration & UICollectionViewCompositionalLayout are operating system dependent apis. Which means you can not use them below there minimum operating system requirements.

enter image description here

As you can see in the screenshot above. These api is available from iOS 14.0+ (beta). And these api is shipped within Xcode 12.0+ (beta).

So In order to use this, you need to download Xcode 12.0(beta) from Developer website or wait for the official App Store release.

Answered on August 31, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.