Skip to content

Commit c081116

Browse files
committed
fix header view issue
1 parent 9e8fc15 commit c081116

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

TBEmptyDataSet.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "TBEmptyDataSet"
4-
s.version = "1.3"
4+
s.version = "1.4"
55
s.summary = "An extension of UITableView/UICollectionView's super class, it will display a placeholder when the data is empty."
66

77
s.homepage = "https://github.com/teambition/TBEmptyDataSet"

TBEmptyDataSet/TBEmptyDataSet.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,11 @@ extension UIScrollView: UIGestureRecognizerDelegate {
243243
emptyDataSetWillAppear()
244244

245245
if emptyDataView.superview == nil {
246-
addSubview(emptyDataView)
247-
bringSubviewToFront(emptyDataView)
246+
if (self is UITableView || self is UICollectionView) && subviews.count > 1 {
247+
insertSubview(emptyDataView, atIndex: 0)
248+
} else {
249+
addSubview(emptyDataView)
250+
}
248251
}
249252
emptyDataView.resetEmptyDataView()
250253

0 commit comments

Comments
 (0)