public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { if (_presenter.Count == indexPath.Row && !_presenter.IsLastReaded) { var loader = (LoaderCollectionCell)collectionView.DequeueReusableCell(nameof(LoaderCollectionCell), indexPath); loader.SetLoader(); return(loader); } else { var post = _presenter[(int)indexPath.Item]; var cell = (SliderFeedCollectionViewCell)collectionView.DequeueReusableCell(nameof(SliderFeedCollectionViewCell), indexPath); var offset = collectionView.GetLayoutAttributesForItem(indexPath).Frame.X - 15 - collectionView.ContentOffset.X; if (post != null) { cell.UpdateCell(post, _flowDelegate.Variables[(int)indexPath.Item], offset); } if (!cell.IsCellActionSet) { cell.CellAction += CellAction; cell.TagAction += TagAction; } return(cell); } }
public UICollectionViewLayoutAttributes GetLayoutAttributesForItem(NSIndexPath indexPath) => collectionView.GetLayoutAttributesForItem(indexPath);