Commit 6612bfd0 by Daniel Dahan

issue-973: Fixed issue where Button.prepare was not being called in the correct order.

parent 6f9f6ca9
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* [issue-982](https://github.com/CosmicMind/Material/issues/982): Updated Icon let declarations to var declarations to allow custom icon sets. * [issue-982](https://github.com/CosmicMind/Material/issues/982): Updated Icon let declarations to var declarations to allow custom icon sets.
* [issue-980](https://github.com/CosmicMind/Material/issues/980): Added `@objc` to extension properties in Material+UIView. * [issue-980](https://github.com/CosmicMind/Material/issues/980): Added `@objc` to extension properties in Material+UIView.
* [issue-650](https://github.com/CosmicMind/Material/issues/650): Fixed issue where `NavigationBar.backButton` would incorrectly be laid out when caching view controllers. * [issue-650](https://github.com/CosmicMind/Material/issues/650): Fixed issue where `NavigationBar.backButton` would incorrectly be laid out when caching view controllers.
* [issue-973](https://github.com/CosmicMind/Material/issues/973): Fixed issue where `Button.prepare` was not being called in the correct order.
## 2.12.16 ## 2.12.16
......
...@@ -187,20 +187,21 @@ open class Button: UIButton, Pulseable, PulseableLayer { ...@@ -187,20 +187,21 @@ open class Button: UIButton, Pulseable, PulseableLayer {
tintColor = Color.blue.base tintColor = Color.blue.base
prepare() prepare()
} }
/// A convenience initializer.
public convenience init() {
self.init(frame: .zero)
}
/// A convenience initializer.
public convenience init() {
self.init(frame: .zero)
}
/** /**
A convenience initializer that acceps an image and tint A convenience initializer that acceps an image and tint
- Parameter image: A UIImage. - Parameter image: A UIImage.
- Parameter tintColor: A UI - Parameter tintColor: A UI
*/ */
public convenience init(image: UIImage?, tintColor: UIColor = Color.blue.base) { public init(image: UIImage?, tintColor: UIColor = Color.blue.base) {
self.init() super.init(frame: .zero)
prepare(with: image, tintColor: tintColor) prepare(with: image, tintColor: tintColor)
prepare()
} }
/** /**
...@@ -208,9 +209,10 @@ open class Button: UIButton, Pulseable, PulseableLayer { ...@@ -208,9 +209,10 @@ open class Button: UIButton, Pulseable, PulseableLayer {
- Parameter title: A String. - Parameter title: A String.
- Parameter titleColor: A UI - Parameter titleColor: A UI
*/ */
public convenience init(title: String?, titleColor: UIColor = Color.blue.base) { public init(title: String?, titleColor: UIColor = Color.blue.base) {
self.init() super.init(frame: .zero)
prepare(with: title, titleColor: titleColor) prepare(with: title, titleColor: titleColor)
prepare()
} }
open override func layoutSubviews() { open override func layoutSubviews() {
......
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