Commit e0f8187c by Daniel Dahan

progressive cleanup

parent 5bf12299
......@@ -24,27 +24,6 @@ public class FabButton : MaterialButton {
*/
public var lineWidth: CGFloat = 2.0
/**
:name: init
*/
public required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
/**
:name: init
*/
public required init(frame: CGRect) {
super.init(frame: frame)
}
/**
:name: init
*/
public convenience init() {
self.init(frame: CGRectZero)
}
//
// :name: prepareButton
//
......@@ -57,22 +36,22 @@ public class FabButton : MaterialButton {
//
// :name: pulseTouches
//
// public override func pulseTouches(touches: Set<NSObject>) {
// super.pulseTouches(touches)
// let touch = touches.first as! UITouch
// let touchLocation = touch.locationInView(self)
// pulseView = UIView()
// pulseView!.frame = CGRectMake(0, 0, bounds.width, bounds.height)
// pulseView!.layer.cornerRadius = bounds.width / 2.0
// pulseView!.center = touchLocation
// pulseView!.backgroundColor = pulseColor?.colorWithAlphaComponent(0.5)
// backgroundColorView.addSubview(pulseView!)
// UIView.animateWithDuration(0.3,
// animations: {
// self.pulseView!.transform = CGAffineTransformMakeScale(3, 3)
// self.transform = CGAffineTransformMakeScale(1.1, 1.1)
// },
// completion: nil
// )
// }
internal override func pulseTouches(touches: Set<NSObject>) {
super.pulseTouches(touches)
let touch = touches.first as! UITouch
let touchLocation = touch.locationInView(self)
pulseView = UIView()
pulseView!.frame = CGRectMake(0, 0, bounds.width, bounds.height)
pulseView!.layer.cornerRadius = bounds.width / 2.0
pulseView!.center = touchLocation
pulseView!.backgroundColor = pulseColor?.colorWithAlphaComponent(0.5)
backgroundColorView.addSubview(pulseView!)
UIView.animateWithDuration(0.3,
animations: {
self.pulseView!.transform = CGAffineTransformMakeScale(3, 3)
self.transform = CGAffineTransformMakeScale(1.1, 1.1)
},
completion: nil
)
}
}
......@@ -19,6 +19,9 @@
import UIKit
public class FlatButton : MaterialButton {
/**
:name: textColor
*/
public var textColor: UIColor?
//
......@@ -32,21 +35,20 @@ public class FlatButton : MaterialButton {
//
// :name: pulseTouches
//
// public override func pulseTouches(touches: Set<NSObject>) {
// super.pulseTouches(touches)
// let touch = touches.first as! UITouch
// let touchLocation = touch.locationInView(self)
// pulseView = UIView()
// pulseView!.frame = CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)
// pulseView!.layer.cornerRadius = bounds.height / 2.0
// pulseView!.center = touchLocation
// pulseView!.backgroundColor = pulseColor!.colorWithAlphaComponent(0.5)
// backgroundColorView.addSubview(pulseView!)
// textColor = self.titleLabel?.textColor
// UIView.animateWithDuration(0.3, animations: {
// self.pulseView!.transform = CGAffineTransformMakeScale(10, 10)
// self.transform = CGAffineTransformMakeScale(1.05, 1.1)
// self.setTitleColor(.whiteColor(), forState: .Normal)
// }, completion: nil)
// }
internal override func pulseTouches(touches: Set<NSObject>) {
super.pulseTouches(touches)
let touch = touches.first as! UITouch
let touchLocation = touch.locationInView(self)
pulseView = UIView()
pulseView!.frame = CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)
pulseView!.layer.cornerRadius = bounds.height / 2.0
pulseView!.center = touchLocation
pulseView!.backgroundColor = pulseColor!.colorWithAlphaComponent(0.5)
backgroundColorView.addSubview(pulseView!)
UIView.animateWithDuration(0.3, animations: {
self.pulseView!.transform = CGAffineTransformMakeScale(10, 10)
self.transform = CGAffineTransformMakeScale(1.05, 1.1)
self.setTitleColor(UIColor.whiteColor(), forState: .Normal)
})
}
}
......@@ -31,23 +31,23 @@ public class RaisedButton : MaterialButton {
//
// :name: pulseTouches
//
// public override func pulseTouches(touches: Set<NSObject>) {
// super.pulseTouches(touches)
// let touch = touches.first as! UITouch
// let touchLocation = touch.locationInView(self)
// pulseView = UIView()
// pulseView!.frame = CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)
// pulseView!.layer.cornerRadius = bounds.height / 2.0
// pulseView!.center = touchLocation
// pulseView!.backgroundColor = pulseColor!.colorWithAlphaComponent(0.5)
// backgroundColorView.addSubview(pulseView!)
// UIView.animateWithDuration(0.3,
// animations: {
// self.pulseView!.transform = CGAffineTransformMakeScale(10, 10)
// self.transform = CGAffineTransformMakeScale(1.05, 1.1)
// },
// completion: nil
// )
// }
internal override func pulseTouches(touches: Set<NSObject>) {
super.pulseTouches(touches)
let touch = touches.first as! UITouch
let touchLocation = touch.locationInView(self)
pulseView = UIView()
pulseView!.frame = CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)
pulseView!.layer.cornerRadius = bounds.height / 2.0
pulseView!.center = touchLocation
pulseView!.backgroundColor = pulseColor!.colorWithAlphaComponent(0.5)
backgroundColorView.addSubview(pulseView!)
UIView.animateWithDuration(0.3,
animations: {
self.pulseView!.transform = CGAffineTransformMakeScale(10, 10)
self.transform = CGAffineTransformMakeScale(1.05, 1.1)
},
completion: nil
)
}
}
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