Skip to content

Commit 4f683ba

Browse files
committed
fix content view frame issue when empty data set is custom
1 parent c081116 commit 4f683ba

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

Example/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.4</string>
18+
<string>1.5</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>5</string>
22+
<string>6</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UILaunchStoryboardName</key>

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.4"
4+
s.version = "1.5"
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/EmptyDataView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class EmptyDataView: UIView {
2222
let contentView = UIView()
2323
contentView.translatesAutoresizingMaskIntoConstraints = false
2424
contentView.backgroundColor = UIColor.clearColor()
25-
contentView.userInteractionEnabled = true
2625
contentView.alpha = 0
2726
return contentView
2827
}()
@@ -32,7 +31,6 @@ class EmptyDataView: UIView {
3231
imageView.translatesAutoresizingMaskIntoConstraints = false
3332
imageView.backgroundColor = UIColor.clearColor()
3433
imageView.contentMode = .ScaleAspectFill
35-
imageView.userInteractionEnabled = false
3634
self.contentView.addSubview(imageView)
3735
return imageView
3836
}()
@@ -139,6 +137,7 @@ class EmptyDataView: UIView {
139137
contentView.addConstraint(NSLayoutConstraint(item: customView, attribute: .CenterY, relatedBy: .Equal, toItem: contentView, attribute: .CenterY, multiplier: 1, constant: 0))
140138
contentView.addConstraint(NSLayoutConstraint(item: customView, attribute: .Width, relatedBy: .Equal, toItem: .None, attribute: .NotAnAttribute, multiplier: 1, constant: customView.frame.width))
141139
contentView.addConstraint(NSLayoutConstraint(item: customView, attribute: .Height, relatedBy: .Equal, toItem: .None, attribute: .NotAnAttribute, multiplier: 1, constant: customView.frame.height))
140+
contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[\(ViewStrings.customView)]|", options: [], metrics: nil, views: [ViewStrings.customView: customView]))
142141
} else {
143142
var viewStrings = [String]()
144143
var views = [String: UIView]()

TBEmptyDataSet/Supporting Files/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.4</string>
18+
<string>1.5</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

TBEmptyDataSet/TBEmptyDataSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ extension UIScrollView: UIGestureRecognizerDelegate {
278278
emptyDataView.backgroundColor = emptyDataSetBackgroundColor()
279279
emptyDataView.hidden = false
280280
emptyDataView.clipsToBounds = true
281-
emptyDataView.userInteractionEnabled = emptyDataSetTapEnabled()
281+
emptyDataView.tapGesture.enabled = emptyDataSetTapEnabled()
282282
scrollEnabled = emptyDataSetScrollEnabled()
283283

284284
emptyDataView.setConstraints()

0 commit comments

Comments
 (0)