Skip to content

Commit

Permalink
Fix TableViewCell skeleton not being removed & automaticNumberOfRows …
Browse files Browse the repository at this point in the history
…reference (#402)

* Change TableView subviewsToSkeleton to all subviews

* Fix reference to automaticNumberOfRows from pr #401
  • Loading branch information
harrisonsj committed Jun 10, 2021
1 parent fb83a62 commit e9ac3a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public protocol SkeletonCollectionViewDataSource: UICollectionViewDataSource {

public extension SkeletonCollectionViewDataSource {
func collectionSkeletonView(_ skeletonView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return Self.automaticNumberOfRows
return SkeletonCollectionDataSource.automaticNumberOfRows
}

func collectionSkeletonView(_ skeletonView: UICollectionView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public protocol SkeletonTableViewDataSource: UITableViewDataSource {

public extension SkeletonTableViewDataSource {
func collectionSkeletonView(_ skeletonView: UITableView, numberOfRowsInSection section: Int) -> Int {
return Self.automaticNumberOfRows
return SkeletonCollectionDataSource.automaticNumberOfRows
}

func numSections(in collectionSkeletonView: UITableView) -> Int { return 1 }
Expand Down
2 changes: 1 addition & 1 deletion Sources/SubviewsSkeletonables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension UITableView {
// Some developer trying to call `view.showAnimatedSkeleton()`
// when the request or data is loading which sometimes happens before the ViewDidAppear
guard window != nil else { return [] }
return visibleCells + visibleSectionHeaders + visibleSectionFooters
return subviews
}
}

Expand Down

0 comments on commit e9ac3a5

Please sign in to comment.