nghialv / MaterialKit

Material design components for iOS written in Swift
MIT License
2.51k stars 290 forks source link

Support tap instead of touch? #30

Open instaqwe opened 9 years ago

instaqwe commented 9 years ago

Anyone know how one would implement the animations with tap instead of touch? The textfield for example:

 override public func beginTrackingWithTouch(touch: UITouch, withEvent event: UIEvent) -> Bool {
    mkLayer.didChangeTapLocation(touch.locationInView(self))

    mkLayer.animateScaleForCircleLayer(0.45, toScale: 1.0, timingFunction: MKTimingFunction.Linear, duration: CFTimeInterval(self.rippleAniDuration))
    mkLayer.animateAlphaForBackgroundLayer(MKTimingFunction.Linear, duration: CFTimeInterval(self.backgroundAniDuration))

    return super.beginTrackingWithTouch(touch, withEvent: event)
}