IWTapGesture is easily customizable tap gesture recognizer with effects.
This is from Demo project.
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var cardView: UIView!
var tapGesture: IWTapGesture!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let options:[IWTapGestureOption] = [
IWTapGestureOption.alpha(0.5),
IWTapGestureOption.backgroundColor(UIColor(red: 0.8, green: 0.8, blue: 0.8, alpha: 1.0)),
IWTapGestureOption.scale(0.98),
IWTapGestureOption.scaleDuration(0.1)
]
self.tapGesture = IWTapGesture(view: self.cardView, action: {
print("View tapped!")
}, options: options)
}
}
- iOS 8.0 or later
- Xcode 8.0 - Swift3
IWTapGesture is available through CocoaPods.
To install add the following line to your Podfile:
pod 'IWTapGesture'
IWTapGesture is also available through Carthage.
Add following line to Cartfile and follow this instruction.
github "Iwark/IWTapGesture"
Manual Installation
The class file required for IWTapGesture is located in the IWTapGesture folder in the root of this repository as listed below:
- IWTapGesture.swift
Please file issues or submit pull requests for anything you’d like to see! :)
IWTapGesture is released under the MIT license.