@@ -94,6 +94,13 @@ import UIKit
97+ @IBInspectable public var labelWidthWeight: CGFloat = 0.5 {
99+ labelWidthWeight = min(1, max(0, labelWidthWeight))
97 private let labelSlideLength: CGFloat = 5
104 private let labelSlideLength: CGFloat = 5
98 private let labelSlideDuration: NSTimeInterval = 0.1
105 private let labelSlideDuration: NSTimeInterval = 0.1
@@ -142,8 +149,8 @@ import UIKit
144 public override func layoutSubviews() {
151 public override func layoutSubviews() {
145− let buttonWidth = bounds.size.width * 0.25
152+ let buttonWidth = bounds.size.width * ((1 - labelWidthWeight) / 2)
146− let labelWidth = bounds.size.width * 0.5
153+ let labelWidth = bounds.size.width * labelWidthWeight
148 leftButton.frame = CGRect(x: 0, y: 0, width: buttonWidth, height: bounds.size.height)
155 leftButton.frame = CGRect(x: 0, y: 0, width: buttonWidth, height: bounds.size.height)
149 label.frame = CGRect(x: buttonWidth, y: 0, width: labelWidth, height: bounds.size.height)
156 label.frame = CGRect(x: buttonWidth, y: 0, width: labelWidth, height: bounds.size.height)