Skip to content

Commit

Permalink
fix header view issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed Mar 31, 2016
1 parent 9e8fc15 commit c081116
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TBEmptyDataSet.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

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

s.homepage = "https://github.com/teambition/TBEmptyDataSet"
Expand Down
7 changes: 5 additions & 2 deletions TBEmptyDataSet/TBEmptyDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ extension UIScrollView: UIGestureRecognizerDelegate {
emptyDataSetWillAppear()

if emptyDataView.superview == nil {
addSubview(emptyDataView)
bringSubviewToFront(emptyDataView)
if (self is UITableView || self is UICollectionView) && subviews.count > 1 {
insertSubview(emptyDataView, atIndex: 0)
} else {
addSubview(emptyDataView)
}
}
emptyDataView.resetEmptyDataView()

Expand Down

0 comments on commit c081116

Please sign in to comment.