maxep / MXParallaxHeader

Simple parallax header for UIScrollView
MIT License
1.73k stars 251 forks source link

collectionView.parallaxHeader is nil #125

Closed LH-Dunzo closed 3 years ago

LH-Dunzo commented 3 years ago

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.

Environment Information

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[bot] commented 3 years ago

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.