Skip to content

Commit 9995c2a

Browse files
committed
Rely on original delegate for section row, delegate, and footer heights
1 parent 17fb1b9 commit 9995c2a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

SkeletonViewCore/Sources/Internal/Collections/SkeletonCollectionDelegate.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ extension SkeletonCollectionDelegate: UITableViewDelegate {
4343
originalTableViewDelegate?.tableView?(tableView, didEndDisplaying: cell, forRowAt: indexPath)
4444
}
4545

46+
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
47+
return originalTableViewDelegate?.tableView?(tableView, heightForRowAt: indexPath) ?? tableView.estimatedRowHeight
48+
}
49+
50+
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
51+
return originalTableViewDelegate?.tableView?(tableView, heightForHeaderInSection: section) ?? tableView.estimatedSectionHeaderHeight
52+
}
53+
54+
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
55+
return originalTableViewDelegate?.tableView?(tableView, heightForFooterInSection: section) ?? tableView.estimatedSectionFooterHeight
56+
}
57+
4658
private func headerOrFooterView(_ tableView: UITableView, for viewIdentifier: String? ) -> UIView? {
4759
guard let viewIdentifier = viewIdentifier, let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: viewIdentifier) else { return nil }
4860
skeletonViewIfContainerSkeletonIsActive(container: tableView, view: header)

0 commit comments

Comments
 (0)