@@ -11,7 +11,7 @@ import UIKit
1111@IBDesignable public class GMStepper: UIControl {
1212
1313 /// Current value of the stepper. Defaults to 0.
14− @objc @IBInspectable public var value: Double = 0 {
14+ @IBInspectable public var value: Double = 0 {
1515 didSet {
1616 value = min(maximumValue, max(minimumValue, value))
1717
@@ -37,44 +37,44 @@ import UIKit
3737 }
3838
3939 /// Minimum value. Must be less than maximumValue. Defaults to 0.
40− @objc @IBInspectable public var minimumValue: Double = 0 {
40+ @IBInspectable public var minimumValue: Double = 0 {
4141 didSet {
4242 value = min(maximumValue, max(minimumValue, value))
4343 }
4444 }
4545
4646 /// Maximum value. Must be more than minimumValue. Defaults to 100.
47− @objc @IBInspectable public var maximumValue: Double = 100 {
47+ @IBInspectable public var maximumValue: Double = 100 {
4848 didSet {
4949 value = min(maximumValue, max(minimumValue, value))
5050 }
5151 }
5252
5353 /// Step/Increment value as in UIStepper. Defaults to 1.
54− @objc @IBInspectable public var stepValue: Double = 1
54+ @IBInspectable public var stepValue: Double = 1
5555
5656 /// The same as UIStepper's autorepeat. If true, holding on the buttons or keeping the pan gesture alters the value repeatedly. Defaults to true.
57− @objc @IBInspectable public var autorepeat: Bool = true
57+ @IBInspectable public var autorepeat: Bool = true
5858
5959 /// If the value is integer, it is shown without floating point.
60− @objc @IBInspectable public var showIntegerIfDoubleIsInteger: Bool = true
60+ @IBInspectable public var showIntegerIfDoubleIsInteger: Bool = true
6161
6262 /// Text on the left button. Be sure that it fits in the button. Defaults to "−".
63− @objc @IBInspectable public var leftButtonText: String = "−" {
63+ @IBInspectable public var leftButtonText: String = "−" {
6464 didSet {
6565 leftButton.setTitle(leftButtonText, for: .normal)
6666 }
6767 }
6868
6969 /// Text on the right button. Be sure that it fits in the button. Defaults to "+".
70− @objc @IBInspectable public var rightButtonText: String = "+" {
70+ @IBInspectable public var rightButtonText: String = "+" {
7171 didSet {
7272 rightButton.setTitle(rightButtonText, for: .normal)
7373 }
7474 }
7575
7676 /// Text color of the buttons. Defaults to white.
77− @objc @IBInspectable public var buttonsTextColor: UIColor = UIColor.white {
77+ @IBInspectable public var buttonsTextColor: UIColor = UIColor.white {
7878 didSet {
7979 for button in [leftButton, rightButton] {
8080 button.setTitleColor(buttonsTextColor, for: .normal)
@@ -83,7 +83,7 @@ import UIKit
8383 }
8484
8585 /// Background color of the buttons. Defaults to dark blue.
86− @objc @IBInspectable public var buttonsBackgroundColor: UIColor = UIColor(red:0.21, green:0.5, blue:0.74, alpha:1) {
86+ @IBInspectable public var buttonsBackgroundColor: UIColor = UIColor(red:0.21, green:0.5, blue:0.74, alpha:1) {
8787 didSet {
8888 for button in [leftButton, rightButton] {
8989 button.backgroundColor = buttonsBackgroundColor
@@ -93,7 +93,7 @@ import UIKit
9393 }
9494
9595 /// Font of the buttons. Defaults to AvenirNext-Bold, 20.0 points in size.
96− @objc public var buttonsFont = UIFont(name: "AvenirNext-Bold", size: 20.0)! {
96+ public var buttonsFont = UIFont(name: "AvenirNext-Bold", size: 20.0)! {
9797 didSet {
9898 for button in [leftButton, rightButton] {
9999 button.titleLabel?.font = buttonsFont
@@ -102,35 +102,28 @@ import UIKit
102102 }
103103
104104 /// Text color of the middle label. Defaults to white.
105− @objc @IBInspectable public var labelTextColor: UIColor = UIColor.white {
105+ @IBInspectable public var labelTextColor: UIColor = UIColor.white {
106106 didSet {
107107 label.textColor = labelTextColor
108108 }
109109 }
110110
111111 /// Text color of the middle label. Defaults to lighter blue.
112− @objc @IBInspectable public var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1) {
112+ @IBInspectable public var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1) {
113113 didSet {
114114 label.backgroundColor = labelBackgroundColor
115115 }
116116 }
117117
118118 /// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
119− @objc public var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)! {
119+ public var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)! {
120120 didSet {
121121 label.font = labelFont
122122 }
123123 }
124− /// Corner radius of the middle label. Defaults to 0.
125− @objc @IBInspectable public var labelCornerRadius: CGFloat = 0 {
126− didSet {
127− label.layer.cornerRadius = labelCornerRadius
128−
129− }
130− }
131124
132125 /// Corner radius of the stepper's layer. Defaults to 4.0.
133− @objc @IBInspectable public var cornerRadius: CGFloat = 4.0 {
126+ @IBInspectable public var cornerRadius: CGFloat = 4.0 {
134127 didSet {
135128 layer.cornerRadius = cornerRadius
136129 clipsToBounds = true
@@ -138,7 +131,7 @@ import UIKit
138131 }
139132
140133 /// Border width of the stepper and middle label's layer. Defaults to 0.0.
141− @objc @IBInspectable public var borderWidth: CGFloat = 0.0 {
134+ @IBInspectable public var borderWidth: CGFloat = 0.0 {
142135 didSet {
143136 layer.borderWidth = borderWidth
144137 label.layer.borderWidth = borderWidth
@@ -146,7 +139,7 @@ import UIKit
146139 }
147140
148141 /// Color of the border of the stepper and middle label's layer. Defaults to clear color.
149− @objc @IBInspectable public var borderColor: UIColor = UIColor.clear {
142+ @IBInspectable public var borderColor: UIColor = UIColor.clear {
150143 didSet {
151144 layer.borderColor = borderColor.cgColor
152145 label.layer.borderColor = borderColor.cgColor
@@ -154,7 +147,7 @@ import UIKit
154147 }
155148
156149 /// Percentage of the middle label's width. Must be between 0 and 1. Defaults to 0.5. Be sure that it is wide enough to show the value.
157− @objc @IBInspectable public var labelWidthWeight: CGFloat = 0.5 {
150+ @IBInspectable public var labelWidthWeight: CGFloat = 0.5 {
158151 didSet {
159152 labelWidthWeight = min(1, max(0, labelWidthWeight))
160153 setNeedsLayout()
@@ -162,7 +155,7 @@ import UIKit
162155 }
163156
164157 /// Color of the flashing animation on the buttons in case the value hit the limit.
165− @objc @IBInspectable public var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
158+ @IBInspectable public var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
166159
167160 /**
168161 Width of the sliding animation. When buttons clicked, the middle label does a slide animation towards to the clicked button. Defaults to 5.
@@ -212,8 +205,6 @@ import UIKit
212205 label.textColor = self.labelTextColor
213206 label.backgroundColor = self.labelBackgroundColor
214207 label.font = self.labelFont
215− label.layer.cornerRadius = self.labelCornerRadius
216− label.layer.masksToBounds = true
217208 label.isUserInteractionEnabled = true
218209 let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(GMStepper.handlePan))
219210 panRecognizer.maximumNumberOfTouches = 1
@@ -245,7 +236,7 @@ import UIKit
245236 }
246237
247238
248− @objc public var items : [String] = [] {
239+ public var items : [String] = [] {
249240 didSet {
250241 let isInteger = floor(value) == value
251242
@@ -291,12 +282,12 @@ import UIKit
291282 }
292283 }
293284
294− @objc required public init?(coder aDecoder: NSCoder) {
285+ required public init?(coder aDecoder: NSCoder) {
295286 super.init(coder: aDecoder)
296287 setup()
297288 }
298289
299− @objc public override init(frame: CGRect) {
290+ public override init(frame: CGRect) {
300291 super.init(frame: frame)
301292 setup()
302293 }
@@ -356,7 +347,7 @@ import UIKit
356347
357348// MARK: Pan Gesture
358349extension GMStepper {
359− @objc func handlePan(gesture: UIPanGestureRecognizer) {
350+ func handlePan(gesture: UIPanGestureRecognizer) {
360351 switch gesture.state {
361352 case .began:
362353 leftButton.isEnabled = false
@@ -406,7 +397,7 @@ extension GMStepper {
406397 }
407398 }
408399
409− @objc func reset() {
400+ func reset() {
410401 panState = .Stable
411402 stepperState = .Stable
412403 resetTimer()
@@ -425,7 +416,7 @@ extension GMStepper {
425416
426417// MARK: Button Events
427418extension GMStepper {
428− @objc func leftButtonTouchDown(button: UIButton) {
419+ func leftButtonTouchDown(button: UIButton) {
429420 rightButton.isEnabled = false
430421 label.isUserInteractionEnabled = false
431422 resetTimer()
@@ -439,7 +430,7 @@ extension GMStepper {
439430
440431 }
441432
442− @objc func rightButtonTouchDown(button: UIButton) {
433+ func rightButtonTouchDown(button: UIButton) {
443434 leftButton.isEnabled = false
444435 label.isUserInteractionEnabled = false
445436 resetTimer()
@@ -452,7 +443,7 @@ extension GMStepper {
452443 }
453444 }
454445
455− @objc func buttonTouchUp(button: UIButton) {
446+ func buttonTouchUp(button: UIButton) {
456447 reset()
457448 }
458449}
@@ -497,7 +488,7 @@ extension GMStepper {
497488
498489// MARK: Timer
499490extension GMStepper {
500− @objc func handleTimerFire(timer: Timer) {
491+ func handleTimerFire(timer: Timer) {
501492 timerFireCount += 1
502493
503494 if timerFireCount % timerFireCountModulo == 0 {