mosaic-layout icon indicating copy to clipboard operation
mosaic-layout copied to clipboard

Footer Not Displayed After using TRMosaicLayout

Open Jayvd opened this issue 7 years ago • 3 comments

This is a superb layout library, but I am facing a serious problem.

collectionView.register(UINib(nibName: "LoadingFooterCollectionReusableView", bundle: nil), forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "loadingFooterIdentifier");

//The delegate function below is no longer called func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { }


Any ideas how to fix this? 

Jayvd avatar Apr 04 '17 10:04 Jayvd

Can you post the error? I don't see anything wrong with the code you posted 😄

vinnyoodles avatar Apr 05 '17 00:04 vinnyoodles

Hi @vinnyoodles , there is no error. It is just that the delegate function 'viewForSupplementaryElementOfKind' is no longer called after I use use the layout

    let mosaicLayout = TRMosaicLayout();
    self.collectionView?.collectionViewLayout = mosaicLayout;
    mosaicLayout.delegate = self;

If I comment the above line out. The delegate will be called/working again.

Jayvd avatar Apr 05 '17 03:04 Jayvd

I have posted a question in SO too addressing this issue.

http://stackoverflow.com/questions/43221323/using-custom-layout-causes-collectionviewflowlayout-delegate-function-not-being?noredirect=1#comment73517175_43221323

Jayvd avatar Apr 05 '17 07:04 Jayvd