Skip to content

Commit

Permalink
use the right delegate method for footers (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanpe authored May 11, 2021
1 parent 318e629 commit 74b5172
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
//

import UIKit

extension UICollectionView: CollectionSkeleton {
var estimatedNumberOfRows: Int {
guard let flowlayout = collectionViewLayout as? UICollectionViewFlowLayout else { return 0 }
return Int(ceil(frame.height / flowlayout.itemSize.height))
switch flowlayout.scrollDirection {
case .vertical:
return Int(ceil(frame.height / flowlayout.itemSize.height))
Expand Down
2 changes: 1 addition & 1 deletion Sources/Collections/SkeletonCollectionDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension SkeletonCollectionDelegate: UITableViewDelegate {
}

func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
headerOrFooterView(tableView, for: originalTableViewDelegate?.collectionSkeletonView(tableView, identifierForHeaderInSection: section))
headerOrFooterView(tableView, for: originalTableViewDelegate?.collectionSkeletonView(tableView, identifierForFooterInSection: section))
}

func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) {
Expand Down

0 comments on commit 74b5172

Please sign in to comment.