@@ -25,8 +25,31 @@ class GMStepper: UIView {
2525 leftButton.addTarget(self, action: "leftButtonTapped:", forControlEvents: .TouchDown)
2626 rightButton.addTarget(self, action: "rightButtonTapped:", forControlEvents: .TouchDown)
2727
28+ label.textAlignment = .Center
29+
2830 addSubview(leftButton)
2931 addSubview(rightButton)
3032 addSubview(label)
3133 }
34+
35+ override func layoutSubviews() {
36+ let buttonSize = Int(frame.size.height)
37+ let labelWidth = Int(frame.size.width) - 2 * buttonSize
38+
39+ let leftButtonFrame = CGRect(x: 0, y: 0, width: buttonSize, height: buttonSize)
40+ let labelFrame = CGRect(x: buttonSize, y: 0, width: labelWidth, height: buttonSize)
41+ let rightButtonFrame = CGRect(x: buttonSize + labelWidth, y: 0, width: buttonSize, height: buttonSize)
42+
43+ leftButton.frame = leftButtonFrame
44+ label.frame = labelFrame
45+ rightButton.frame = rightButtonFrame
46+ }
47+
48+ func leftButtonTapped(button: UIButton) {
49+
50+ }
51+
52+ func rightButtonTapped(button: UIButton) {
53+
54+ }
3255}