Skip to content

CollectionCoordinatorDelegate's background view does not behave as documented #31

@JosephDuffy

Description

@JosephDuffy

Describe the bug

The documentation of CollectionCoordinatorDelegate.coordinator(_:backgroundViewInCollectionView:) states:

Return a background view to be shown in the UICollectionView when its content is empty. Defaults to nil

This is wrong because the background view is set even when the collection view is not empty.

It also causes what I could class as a bug: whenever CollectionCoordinator.prepareSections() is called it will reset the background view, even when the delegate is nil.

To Reproduce

Use CollectionCoordinator

Expected behavior

  1. Do not reset backgroundView when delegate is nil or the default implementation of CollectionCoordinatorDelegate.coordinator(_:backgroundViewInCollectionView:) is used
  2. Only show the background when the collection view is empty

Environment

  • OS Version: Any
  • Library Version: 1.x, 2.x
  • Device: Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions