Commit fa84e1bf by Daniel Dahan

updated

parent 5580bc33
......@@ -108,22 +108,23 @@ public class FabButton : UIButton {
layer.shadowRadius = 5
}
override public func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
public override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
super.touchesBegan(touches, withEvent: event)
pulseTouches(touches)
}
override public func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {
}
public override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {
super.touchesEnded(touches, withEvent: event)
shrink()
removePulse()
}
public override func touchesCancelled(touches: Set<NSObject>!, withEvent event: UIEvent!) {
shrink()
removePulse()
}
removePulse()
}
public override func touchesCancelled(touches: Set<NSObject>!, withEvent event: UIEvent!) {
super.touchesCancelled(touches, withEvent: event)
shrink()
removePulse()
}
func pulseTouches(touches: NSSet) {
let touch = touches.allObjects.last as! UITouch
let touchLocation = touch.locationInView(self)
......
......@@ -77,16 +77,19 @@ public class FlatButton : UIButton {
}
public override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
pulseTouches(touches)
super.touchesBegan(touches, withEvent: event)
pulseTouches(touches)
}
public override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {
shrink()
removePulse()
super.touchesEnded(touches, withEvent: event)
shrink()
removePulse()
}
public override func touchesCancelled(touches: Set<NSObject>!, withEvent event: UIEvent!) {
shrink()
super.touchesCancelled(touches, withEvent: event)
shrink()
removePulse()
}
......
......@@ -78,18 +78,21 @@ public class RaisedButton : UIButton {
}
public override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
super.touchesBegan(touches, withEvent: event)
pulseTouches(touches)
}
public override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {
super.touchesEnded(touches, withEvent: event)
shrink()
removePulse()
}
public override func touchesCancelled(touches: Set<NSObject>!, withEvent event: UIEvent!) {
super.touchesCancelled(touches, withEvent: event)
shrink()
removePulse()
}
public override func touchesCancelled(touches: Set<NSObject>!, withEvent event: UIEvent!) {
shrink()
removePulse()
}
func pulseTouches(touches: NSSet) {
let touch = touches.allObjects.last as! UITouch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment