on a47725d help sign in
6 files changed+42−57
since splitsnapshots
unifiedsplit
.swift-version+1−1 GMStepper.podspec+2−2 GMStepper/GMStepper.swift+29−29 GMStepperExample/GMStepperExample.xcodeproj/project.pbxproj+6−23 GMStepperExample/GMStepperExample/ViewController.swift+1−1 README.md+3−1
.swift-version+1−1
@@ -1 +1 @@
1−4.0
1+3.0
GMStepper.podspec+2−2
@@ -1,9 +1,9 @@
11Pod::Spec.new do |s|
22 s.name = "GMStepper"
3− s.version = "2.1"
3+ s.version = "2.0.0"
44 s.summary = "A stepper with a sliding label in the middle."
55 s.homepage = "https://github.com/gmertk/GMStepper"
6− s.screenshots = "https://raw.githubusercontent.com/gmertk/GMStepper/master/Screenshots/screenshot_1.gif"
6+ s.screenshots = "https://dl.dropboxusercontent.com/u/4397140/pod-screenshots/screenshot_1.png"
77 s.license = 'MIT'
88 s.author = { "Gunay Mert Karadogan" => "mertkaradogan@gmail.com" }
99 s.source = { :git => "https://github.com/gmertk/GMStepper.git", :tag => s.version.to_s }
GMStepper/GMStepper.swift+29−29
@@ -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,27 +102,27 @@ 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 }
124124 /// Corner radius of the middle label. Defaults to 0.
125− @objc @IBInspectable public var labelCornerRadius: CGFloat = 0 {
125+ @IBInspectable public var labelCornerRadius: CGFloat = 0 {
126126 didSet {
127127 label.layer.cornerRadius = labelCornerRadius
128128
@@ -130,7 +130,7 @@ import UIKit
130130 }
131131
132132 /// Corner radius of the stepper's layer. Defaults to 4.0.
133− @objc @IBInspectable public var cornerRadius: CGFloat = 4.0 {
133+ @IBInspectable public var cornerRadius: CGFloat = 4.0 {
134134 didSet {
135135 layer.cornerRadius = cornerRadius
136136 clipsToBounds = true
@@ -138,7 +138,7 @@ import UIKit
138138 }
139139
140140 /// Border width of the stepper and middle label's layer. Defaults to 0.0.
141− @objc @IBInspectable public var borderWidth: CGFloat = 0.0 {
141+ @IBInspectable public var borderWidth: CGFloat = 0.0 {
142142 didSet {
143143 layer.borderWidth = borderWidth
144144 label.layer.borderWidth = borderWidth
@@ -146,7 +146,7 @@ import UIKit
146146 }
147147
148148 /// 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 {
149+ @IBInspectable public var borderColor: UIColor = UIColor.clear {
150150 didSet {
151151 layer.borderColor = borderColor.cgColor
152152 label.layer.borderColor = borderColor.cgColor
@@ -154,7 +154,7 @@ import UIKit
154154 }
155155
156156 /// 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 {
157+ @IBInspectable public var labelWidthWeight: CGFloat = 0.5 {
158158 didSet {
159159 labelWidthWeight = min(1, max(0, labelWidthWeight))
160160 setNeedsLayout()
@@ -162,7 +162,7 @@ import UIKit
162162 }
163163
164164 /// 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)
165+ @IBInspectable public var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
166166
167167 /**
168168 Width of the sliding animation. When buttons clicked, the middle label does a slide animation towards to the clicked button. Defaults to 5.
@@ -245,7 +245,7 @@ import UIKit
245245 }
246246
247247
248− @objc public var items : [String] = [] {
248+ public var items : [String] = [] {
249249 didSet {
250250 let isInteger = floor(value) == value
251251
@@ -291,12 +291,12 @@ import UIKit
291291 }
292292 }
293293
294− @objc required public init?(coder aDecoder: NSCoder) {
294+ required public init?(coder aDecoder: NSCoder) {
295295 super.init(coder: aDecoder)
296296 setup()
297297 }
298298
299− @objc public override init(frame: CGRect) {
299+ public override init(frame: CGRect) {
300300 super.init(frame: frame)
301301 setup()
302302 }
@@ -356,7 +356,7 @@ import UIKit
356356
357357// MARK: Pan Gesture
358358extension GMStepper {
359− @objc func handlePan(gesture: UIPanGestureRecognizer) {
359+ func handlePan(gesture: UIPanGestureRecognizer) {
360360 switch gesture.state {
361361 case .began:
362362 leftButton.isEnabled = false
@@ -406,7 +406,7 @@ extension GMStepper {
406406 }
407407 }
408408
409− @objc func reset() {
409+ func reset() {
410410 panState = .Stable
411411 stepperState = .Stable
412412 resetTimer()
@@ -425,7 +425,7 @@ extension GMStepper {
425425
426426// MARK: Button Events
427427extension GMStepper {
428− @objc func leftButtonTouchDown(button: UIButton) {
428+ func leftButtonTouchDown(button: UIButton) {
429429 rightButton.isEnabled = false
430430 label.isUserInteractionEnabled = false
431431 resetTimer()
@@ -439,7 +439,7 @@ extension GMStepper {
439439
440440 }
441441
442− @objc func rightButtonTouchDown(button: UIButton) {
442+ func rightButtonTouchDown(button: UIButton) {
443443 leftButton.isEnabled = false
444444 label.isUserInteractionEnabled = false
445445 resetTimer()
@@ -452,7 +452,7 @@ extension GMStepper {
452452 }
453453 }
454454
455− @objc func buttonTouchUp(button: UIButton) {
455+ func buttonTouchUp(button: UIButton) {
456456 reset()
457457 }
458458}
@@ -497,7 +497,7 @@ extension GMStepper {
497497
498498// MARK: Timer
499499extension GMStepper {
500− @objc func handleTimerFire(timer: Timer) {
500+ func handleTimerFire(timer: Timer) {
501501 timerFireCount += 1
502502
503503 if timerFireCount % timerFireCountModulo == 0 {
GMStepperExample/GMStepperExample.xcodeproj/project.pbxproj+6−23
@@ -163,19 +163,18 @@
163163 attributes = {
164164 LastSwiftMigration = 0700;
165165 LastSwiftUpdateCheck = 0800;
166− LastUpgradeCheck = 0900;
166+ LastUpgradeCheck = 0800;
167167 ORGANIZATIONNAME = "Gunay Mert Karadogan";
168168 TargetAttributes = {
169169 3116C0D71DA4DD360015AC69 = {
170170 CreatedOnToolsVersion = 8.0;
171− LastSwiftMigration = 0900;
172171 ProvisioningStyle = Automatic;
173172 TestTargetID = 319C19311B4843EB005EFEE5;
174173 };
175174 319C19311B4843EB005EFEE5 = {
176175 CreatedOnToolsVersion = 6.4;
177176 DevelopmentTeam = 289M6XEDV4;
178− LastSwiftMigration = 0900;
177+ LastSwiftMigration = 0800;
179178 };
180179 };
181180 };
@@ -282,8 +281,7 @@
282281 PRODUCT_BUNDLE_IDENTIFIER = com.gmertk.GMStepperExampleTests;
283282 PRODUCT_NAME = "$(TARGET_NAME)";
284283 SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
285− SWIFT_SWIFT3_OBJC_INFERENCE = On;
286− SWIFT_VERSION = 4.0;
284+ SWIFT_VERSION = 3.0;
287285 TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
288286 };
289287 name = Debug;
@@ -300,8 +298,7 @@
300298 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
301299 PRODUCT_BUNDLE_IDENTIFIER = com.gmertk.GMStepperExampleTests;
302300 PRODUCT_NAME = "$(TARGET_NAME)";
303− SWIFT_SWIFT3_OBJC_INFERENCE = On;
304− SWIFT_VERSION = 4.0;
301+ SWIFT_VERSION = 3.0;
305302 TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
306303 };
307304 name = Release;
@@ -314,20 +311,14 @@
314311 CLANG_CXX_LIBRARY = "libc++";
315312 CLANG_ENABLE_MODULES = YES;
316313 CLANG_ENABLE_OBJC_ARC = YES;
317− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
318314 CLANG_WARN_BOOL_CONVERSION = YES;
319− CLANG_WARN_COMMA = YES;
320315 CLANG_WARN_CONSTANT_CONVERSION = YES;
321316 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
322317 CLANG_WARN_EMPTY_BODY = YES;
323318 CLANG_WARN_ENUM_CONVERSION = YES;
324319 CLANG_WARN_INFINITE_RECURSION = YES;
325320 CLANG_WARN_INT_CONVERSION = YES;
326− CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
327− CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
328321 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329− CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
330− CLANG_WARN_STRICT_PROTOTYPES = YES;
331322 CLANG_WARN_SUSPICIOUS_MOVE = YES;
332323 CLANG_WARN_UNREACHABLE_CODE = YES;
333324 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -367,20 +358,14 @@
367358 CLANG_CXX_LIBRARY = "libc++";
368359 CLANG_ENABLE_MODULES = YES;
369360 CLANG_ENABLE_OBJC_ARC = YES;
370− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
371361 CLANG_WARN_BOOL_CONVERSION = YES;
372− CLANG_WARN_COMMA = YES;
373362 CLANG_WARN_CONSTANT_CONVERSION = YES;
374363 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
375364 CLANG_WARN_EMPTY_BODY = YES;
376365 CLANG_WARN_ENUM_CONVERSION = YES;
377366 CLANG_WARN_INFINITE_RECURSION = YES;
378367 CLANG_WARN_INT_CONVERSION = YES;
379− CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
380− CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
381368 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
382− CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
383− CLANG_WARN_STRICT_PROTOTYPES = YES;
384369 CLANG_WARN_SUSPICIOUS_MOVE = YES;
385370 CLANG_WARN_UNREACHABLE_CODE = YES;
386371 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -414,8 +399,7 @@
414399 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
415400 PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
416401 PRODUCT_NAME = "$(TARGET_NAME)";
417− SWIFT_SWIFT3_OBJC_INFERENCE = Default;
418− SWIFT_VERSION = 4.0;
402+ SWIFT_VERSION = 3.0;
419403 };
420404 name = Debug;
421405 };
@@ -428,8 +412,7 @@
428412 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
429413 PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
430414 PRODUCT_NAME = "$(TARGET_NAME)";
431− SWIFT_SWIFT3_OBJC_INFERENCE = Default;
432− SWIFT_VERSION = 4.0;
415+ SWIFT_VERSION = 3.0;
433416 };
434417 name = Release;
435418 };
GMStepperExample/GMStepperExample/ViewController.swift+1−1
@@ -16,7 +16,7 @@ class ViewController: UIViewController {
1616 stepper.addTarget(self, action: #selector(ViewController.stepperValueChanged), for: .valueChanged)
1717 }
1818
19− @objc func stepperValueChanged(stepper: GMStepper) {
19+ func stepperValueChanged(stepper: GMStepper) {
2020 print(stepper.value, terminator: "")
2121 }
2222}
README.md+3−1
@@ -5,6 +5,8 @@
55
66A stepper with a sliding label in the middle. Pan the label or tap the buttons. Check out the tutorial, [How to Build a Custom Stepper - Part 1](http://gmertk.github.io/custom-stepper-part-1/).
77
8+**I'm looking for a maintainer who is willing to keep this library updated. Feel free to contact me.**
9+
810
911## Screenshot
1012
@@ -91,7 +93,7 @@ var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, al
9193
9294## Authors
9395
94−* [Brent Whitman](https://github.com/bwhtmn) - Maintainer
96+* [Brent W.](https://github.com/bwhtmn) - Maintainer
9597* [Günay Mert Karadoğan](https://github.com/gmertk) - Creator
9698
9799## License