Commit fd0b041e by Daniel Dahan

development: updated Toolbar title and detail to be @IBInspectable

parent 8d997a6d
......@@ -33,7 +33,8 @@ import UIKit
private var ToolbarContext: UInt8 = 0
open class Toolbar: Bar {
/// A convenience property to set the titleLabel text.
/// A convenience property to set the titleLabel.text.
@IBInspectable
open var title: String? {
get {
return titleLabel.text
......@@ -45,9 +46,11 @@ open class Toolbar: Bar {
}
/// Title label.
open fileprivate(set) lazy var titleLabel = UILabel()
@IBInspectable
open let titleLabel = UILabel()
/// A convenience property to set the detailLabel text.
/// A convenience property to set the detailLabel.text.
@IBInspectable
open var detail: String? {
get {
return detailLabel.text
......@@ -59,7 +62,8 @@ open class Toolbar: Bar {
}
/// Detail label.
open fileprivate(set) lazy var detailLabel = UILabel()
@IBInspectable
open let detailLabel = UILabel()
deinit {
removeObserver(self, forKeyPath: "titleLabel.textAlignment")
......@@ -142,9 +146,11 @@ open class Toolbar: Bar {
prepareTitleLabel()
prepareDetailLabel()
}
}
extension Toolbar {
/// Prepares the titleLabel.
private func prepareTitleLabel() {
fileprivate func prepareTitleLabel() {
titleLabel.textAlignment = .center
titleLabel.contentScaleFactor = Screen.scale
titleLabel.font = RobotoFont.medium(with: 17)
......@@ -153,7 +159,7 @@ open class Toolbar: Bar {
}
/// Prepares the detailLabel.
private func prepareDetailLabel() {
fileprivate func prepareDetailLabel() {
detailLabel.textAlignment = .center
detailLabel.contentScaleFactor = Screen.scale
detailLabel.font = RobotoFont.regular(with: 12)
......
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