whenTapped is a Swift Library that is adding a touch event to UIView.
Inspired by: https://github.com/VincentNarbot/whenTapped
Only support SPM
import whenTapped
view.whenTapped {
print("view whenTapped")
}
view.whenTapped(target: self, selector: #selector(whenTapped))
view.whenTapped(self, handler: { (context) in
context.whenTapped()
})
equals to:
view.whenTapped { [weak self] in
guard let strongSelf = self else { return }
strongSelf.whenTapped()
}