@@ -93,6 +93,9 @@ import UIKit
96+ private let labelSlideLength: CGFloat = 5
97+ private let labelSlideDuration: NSTimeInterval = 0.1
96 private let leftButton = UIButton()
99 private let leftButton = UIButton()
97 private let rightButton = UIButton()
100 private let rightButton = UIButton()
98 private let label = UILabel()
101 private let label = UILabel()
@@ -129,6 +132,7 @@ import UIKit
129 label.font = labelFont
132 label.font = labelFont
130 addSubview(label)
133 addSubview(label)
135+ backgroundColor = buttonsBackgroundColor
132 layer.cornerRadius = cornerRadius
136 layer.cornerRadius = cornerRadius
133 clipsToBounds = true
137 clipsToBounds = true
@@ -144,9 +148,31 @@ import UIKit
145 @objc private func leftButtonTapped(button: UIButton) {
149 @objc private func leftButtonTapped(button: UIButton) {
146 value -= 1
150 value -= 1
149 @objc private func rightButtonTapped(button: UIButton) {
154 @objc private func rightButtonTapped(button: UIButton) {
150 value += 1
155 value += 1
159+ private func animateSlideLeft() {
160+ UIView.animateWithDuration(labelSlideDuration, animations: {
161+ self.label.center.x -= self.labelSlideLength
162+ }, completion : { _ in
163+ UIView.animateWithDuration(self.labelSlideDuration, animations: {
164+ self.label.center.x += self.labelSlideLength
169+ private func animateSlideRight() {
170+ UIView.animateWithDuration(labelSlideDuration, animations: {
171+ self.label.center.x += self.labelSlideLength
172+ }, completion : { _ in
173+ UIView.animateWithDuration(self.labelSlideDuration, animations: {
174+ self.label.center.x -= self.labelSlideLength