Skip to content

Commit

Permalink
Rewrite hit test method for empty view.
Browse files Browse the repository at this point in the history
  • Loading branch information
贾大伟 committed Sep 26, 2019
1 parent 438522e commit 1994136
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DJEmptyViewDemo/DJEmptyViewDemo/DJEmptyView/DJEmptyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ public class DJEmptyView: UIView {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
/// You can hit the components below the empty view
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let hitView = super.hitTest(point, with: event)

if hitView == self {
return nil
}

return hitView
}
}

extension DJEmptyView {
Expand Down

0 comments on commit 1994136

Please sign in to comment.