For iOS13 my cell class is UICollectionViewCell, and in iOS14 i want the same class to be UICollectionViewListCell, which is available only in iOS14 for the list layout, that i am using under iOS14
Is there a way of achieving it?
Note: this is a simple case, but i have many cells, so having 2 different classes for each iOS is not an option
@available(iOS 13, *)
class MyCell: UICollectionViewCell {
}
@available(iOS 14, *)
class MyCell: UICollectionViewListCell {
}
What you want to do is conditionally compile one or the other, so what you need is something that has this form: