Commit a3638453 by Daniel Dahan

development: updated button to handle background at better operation time

parent d24172ff
...@@ -100,6 +100,7 @@ public class MaterialButton : UIButton { ...@@ -100,6 +100,7 @@ public class MaterialButton : UIButton {
*/ */
final public override func drawRect(rect: CGRect) { final public override func drawRect(rect: CGRect) {
prepareContext(rect) prepareContext(rect)
prepareBackgroundColorView()
prepareButton() prepareButton()
} }
...@@ -108,7 +109,6 @@ public class MaterialButton : UIButton { ...@@ -108,7 +109,6 @@ public class MaterialButton : UIButton {
// //
internal func prepareView() { internal func prepareView() {
setTranslatesAutoresizingMaskIntoConstraints(false) setTranslatesAutoresizingMaskIntoConstraints(false)
prepareBackgroundColorView()
} }
// //
...@@ -166,8 +166,6 @@ public class MaterialButton : UIButton { ...@@ -166,8 +166,6 @@ public class MaterialButton : UIButton {
// //
// :name: prepareBackgroundColorView // :name: prepareBackgroundColorView
// //
// We need this view so we can use the masksToBounds
// so the pulse doesn't animate off the button
private func prepareBackgroundColorView() { private func prepareBackgroundColorView() {
backgroundColorView.setTranslatesAutoresizingMaskIntoConstraints(false) backgroundColorView.setTranslatesAutoresizingMaskIntoConstraints(false)
backgroundColorView.layer.masksToBounds = true backgroundColorView.layer.masksToBounds = true
......
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