I am trying to implement right to left flow of cells in my UICollectionView using swift. I tried layoutAttributesForItemAtIndexPath
but it does not work. Here is my method.
func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes! {
var layOutAttributes : UICollectionViewLayoutAttributes!
if indexPath.item % 3 == 0 {
layOutAttributes.frame = CGRectMake((self.namesCollectionView.frame.width * 2)/3 , (self.namesCollectionView.frame.width * 2) / 3, self.namesCollectionView.frame.width/3, namesCollectionView.frame.width/3)
}
return layOutAttributes
}
Need a direction how can I achieve right to left flow?