title: Show different layout section if collection view section has no data to display
body: <p>I am trying to implement a collection view that consists of the following sections:</p>
  <p><strong>User section</strong>: Showing the user's profile info (avatar, email, etc)</p>
  <p><strong>Children section</strong>: Showing the user's children (if available)</p>
  <p><strong>Statistics section</strong>: Showing the user's statistics (if available)</p>
  <img src="https://i.stack.imgur.com/vYW12.png" height="500" />
  <h1><strong>The problem I face</strong></h1>
  <p>I cannot figure out how to show a placeholder cell in case the user has no children or no statistics.</p>
  <h1><strong>What I can do</strong></h1>
  <p>Hide the sections (children, statistics) if there is no data.</p>
  <h1>What I want</h1>
  <p>Show an empty section with a placeholder if no children</p>
  <p>Show an empty section with a placeholder if there are no statistics</p>
  <h1>This is what I tried so far</h1>
  <pre><code>enum UserProfileSection {
      case user
      case children
      case statistics
  }
  </code></pre>
  <pre><code>        let layout = UICollectionViewCompositionalLayout(sectionProvider: { sectionNumber, env in
              let sectionIdentifier = self.dataSource.snapshot().sectionIdentifiers[sectionNumber]
              
              if sectionIdentifier == .user {
                  return UserProfileVC.userSection()
              } else if (sectionIdentifier == .children) {
                  if let userChildren = self.userProfileSectionData?.children, !userChildren.isEmpty {
                      return UserProfileVC.childrenSection()
                  } else {
                      return UserProfileVC.emptyChildrenSection()
                  }
              } else if (sectionIdentifier == .statistics) {
                  if let stats = self.userProfileSectionData?.stats, !stats.isEmpty {
                      return UserProfileVC.statsSection()
                  } else {
                      return UserProfileVC.emptyStatsSection()
                  }
              } else {
                  return nil
              }
          })
          
          self.collectionView.setCollectionViewLayout(layout, animated: true)
        
  </code></pre>
  <pre><code>       Firebase.Database.database().fetchLoggedInUserProfileData { userProfileSectionData in
      
              self.userProfileSectionData = userProfileSectionData
              
              var snapshot = NSDiffableDataSourceSnapshot&lt;UserProfileSection, AnyHashable&gt;()
              
              
              if let _ = userProfileSectionData.settings?.uid {
                  snapshot.appendSections([.user])
                  snapshot.appendItems([userProfileSectionData.user], toSection: .user)
              }
              
              snapshot.appendSections([.children])
              snapshot.appendItems(userProfileSectionData.children ?? [], toSection: .children)
  
              snapshot.appendSections([.statistics])
              snapshot.appendItems(userProfileSectionData.statistics ?? [], toSection: .statistics)
  
              self.dataSource.apply(snapshot, animatingDifferences: animated)
          }   
  </code></pre>
  <p>The problem is that the snapshot will not contain any children or statistics data if I return an empty array from the Firebase call. So the sections .children and/or .statistics will be hidden.</p>
  <p>The user has no children linked. I want to insert a different layout section in case the user has no children; not hide it.</p>
  <img src="https://i.stack.imgur.com/z4whv.png" height="500" />
  <p>Any idea how to achieve this? Thanks in advance.</p>