Skip to content

Commit

Permalink
Merge pull request #21 from bguidolim/tap-gesture-item-label
Browse files Browse the repository at this point in the history
Enabling tap gesture to the item label
  • Loading branch information
pedrommcarrasco committed Oct 19, 2021
2 parents ad4879c + 50158ad commit c9def49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Hover.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'Hover'
spec.version = '2.0.0'
spec.version = '2.1.0'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.homepage = 'https://github.com/pedrommcarrasco/Hover'
spec.authors = { 'Pedro Carrasco' => 'https://twitter.com/pedrommcarrasco' }
Expand Down
5 changes: 5 additions & 0 deletions Hover/UI/HoverItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class HoverItemView: UIStackView {
}

self.label.text = item.title

super.init(frame: .zero)
configure(with: configuration)
}
Expand Down Expand Up @@ -77,6 +78,10 @@ private extension HoverItemView {

func setupSubviews() {
button.addTarget(self, action: #selector(onTapInButton), for: .touchUpInside)

let tapGesture = UITapGestureRecognizer(target: self, action: #selector(onTapInButton))
label.addGestureRecognizer(tapGesture)
label.isUserInteractionEnabled = true
}
}

Expand Down

0 comments on commit c9def49

Please sign in to comment.