Reputation: 13628
I was looking through the Apple documentation on the UICollectionViewLayout
and saw this:
An abstract base class for generating layout information for a collection view.
As you can see, they refer to this as an abstract class, and yet, there are questions like this littered all over SO:
Abstract classes in Swift Language
In all of these, the answers say that there is no concept of "abstract class" in Objective-C or Swift.
If this is true, why do they continuously refer to it?
Upvotes: 3
Views: 142
Reputation: 6992
True, there are no abstract classes in Swift, the closest representation would be protocols.
But in this particular case abstract class means that you're not supposed to use UICollectionViewLayout
class yourself - either subclass it to provide a custom layout and behaviour, or use UICollectionViewFlowLayout
(which inherits from UICollectionViewLayout
) if you want the default layout.
Upvotes: 1