UIView-TapGesture-With-Closures-Swift Adding Gesture Recognizers with Closures Instead of Selectors Usage Drag & drop the Extension-UIView.swift file to your project. Tap Gesture in a closure sampleView.addTapGestureRecognizer { print("view tapped") }