Reputation: 8138
I cannot retrieve contentSize from flow layout with the following code
let contentSize: CGSize = self.collectionView?.collectionViewLayout.collectionViewContentSize()!
Instead I get error:
Could not find member 'collectionViewContentSize'
If I print value it returns properly:
println("content size \(self.collectionView?.collectionViewLayout.collectionViewContentSize())")
Is this swift compiler issue?
Upvotes: 0
Views: 1096
Reputation: 6363
You must cast collectionViewLayout
to specific layout. If you use UICollectionViewFlowLayout
it will look something like this:
if let flow = collectionMain.collectionViewLayout as? UICollectionViewFlowLayout
{
let contentSize: CGSize = flow.collectionViewContentSize()
}
Upvotes: 2