maxep/MXParallaxHeader

collectionView.parallaxHeader is nil

Closed this issue · 1 comments

Issue Description

We are using parallaxHeader inside a collection view. Hence, whenever a collection view reload is called, we try to configure the parallaxHeader again. Now, at times collectionView.parallaxHeader is null. So, it crashes.

  • Steps To Reproduce
    Try calling reload on a collection view using parallaxHeader from background.

Environment Information

  • Lib Version - 1.1.0
  • OS Version - iOS 12-iOS 15

Code

func setupHeaderView() -> XYZHeaderView {
      let header = XYZHeaderView()
      collectionView.parallaxHeader.view = header
      collectionView.parallaxHeader.height = XYZHeaderView.maxHeight
      collectionView.parallaxHeader.minimumHeight = XYZHeaderView.minHeight
      collectionView.parallaxHeader.mode = .fill
      return header
  }
  let headerView = setupHeaderView() 
  // Accessing  headerView / collectionView.parallaxHeader after a collection view reload crashes
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.