on f52eb04 help sign in
10 files changed+202−218
since splitsnapshots
unifiedsplit
.swift-version−1 GMStepper.podspec+2−2 GMStepper/GMStepper.swift+28−40 GMStepperExample/GMStepperExample.xcodeproj/project.pbxproj+120−124 GMStepperExample/GMStepperExample/AppDelegate.swift+10−10 GMStepperExample/GMStepperExample/Base.lproj/Main.storyboard+34−30 GMStepperExample/GMStepperExample/ViewController.swift+1−1 GMStepperExample/GMStepperExampleTests/GMStepperExampleTests.swift+3−3 GMStepperExample/GMStepperExampleTests/Info.plist+2 README.md+2−7
.swift-versiondeleted−1
@@ -1 +0,0 @@
1−4.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 = "1.2.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+28−40
@@ -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.
@@ -184,7 +177,6 @@ import UIKit
184177 button.addTarget(self, action: #selector(GMStepper.leftButtonTouchDown), for: .touchDown)
185178 button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
186179 button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
187− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
188180 return button
189181 }()
190182
@@ -197,7 +189,6 @@ import UIKit
197189 button.addTarget(self, action: #selector(GMStepper.rightButtonTouchDown), for: .touchDown)
198190 button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
199191 button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
200− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
201192 return button
202193 }()
203194
@@ -212,8 +203,6 @@ import UIKit
212203 label.textColor = self.labelTextColor
213204 label.backgroundColor = self.labelBackgroundColor
214205 label.font = self.labelFont
215− label.layer.cornerRadius = self.labelCornerRadius
216− label.layer.masksToBounds = true
217206 label.isUserInteractionEnabled = true
218207 let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(GMStepper.handlePan))
219208 panRecognizer.maximumNumberOfTouches = 1
@@ -245,7 +234,7 @@ import UIKit
245234 }
246235
247236
248− @objc public var items : [String] = [] {
237+ public var items : [String] = [] {
249238 didSet {
250239 let isInteger = floor(value) == value
251240
@@ -291,12 +280,12 @@ import UIKit
291280 }
292281 }
293282
294− @objc required public init?(coder aDecoder: NSCoder) {
283+ required public init?(coder aDecoder: NSCoder) {
295284 super.init(coder: aDecoder)
296285 setup()
297286 }
298287
299− @objc public override init(frame: CGRect) {
288+ public override init(frame: CGRect) {
300289 super.init(frame: frame)
301290 setup()
302291 }
@@ -309,7 +298,6 @@ import UIKit
309298 backgroundColor = buttonsBackgroundColor
310299 layer.cornerRadius = cornerRadius
311300 clipsToBounds = true
312− labelOriginalCenter = label.center
313301
314302 NotificationCenter.default.addObserver(self, selector: #selector(GMStepper.reset), name: NSNotification.Name.UIApplicationWillResignActive, object: nil)
315303 }
@@ -356,7 +344,7 @@ import UIKit
356344
357345// MARK: Pan Gesture
358346extension GMStepper {
359− @objc func handlePan(gesture: UIPanGestureRecognizer) {
347+ func handlePan(gesture: UIPanGestureRecognizer) {
360348 switch gesture.state {
361349 case .began:
362350 leftButton.isEnabled = false
@@ -406,7 +394,7 @@ extension GMStepper {
406394 }
407395 }
408396
409− @objc func reset() {
397+ func reset() {
410398 panState = .Stable
411399 stepperState = .Stable
412400 resetTimer()
@@ -425,7 +413,7 @@ extension GMStepper {
425413
426414// MARK: Button Events
427415extension GMStepper {
428− @objc func leftButtonTouchDown(button: UIButton) {
416+ func leftButtonTouchDown(button: UIButton) {
429417 rightButton.isEnabled = false
430418 label.isUserInteractionEnabled = false
431419 resetTimer()
@@ -439,7 +427,7 @@ extension GMStepper {
439427
440428 }
441429
442− @objc func rightButtonTouchDown(button: UIButton) {
430+ func rightButtonTouchDown(button: UIButton) {
443431 leftButton.isEnabled = false
444432 label.isUserInteractionEnabled = false
445433 resetTimer()
@@ -452,7 +440,7 @@ extension GMStepper {
452440 }
453441 }
454442
455− @objc func buttonTouchUp(button: UIButton) {
443+ func buttonTouchUp(button: UIButton) {
456444 reset()
457445 }
458446}
@@ -497,7 +485,7 @@ extension GMStepper {
497485
498486// MARK: Timer
499487extension GMStepper {
500− @objc func handleTimerFire(timer: Timer) {
488+ func handleTimerFire(timer: Timer) {
501489 timerFireCount += 1
502490
503491 if timerFireCount % timerFireCountModulo == 0 {
GMStepperExample/GMStepperExample.xcodeproj/project.pbxproj+120−124
@@ -7,18 +7,18 @@
77 objects = {
88
99/* Begin PBXBuildFile section */
10− 3116C0DB1DA4DD360015AC69 /* GMStepperExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3116C0DA1DA4DD360015AC69 /* GMStepperExampleTests.swift */; };
11− 3198AC771DA4DEE500311FB3 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
10+ 3169DD3E1B496C33009791D1 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
1211 319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19371B4843EB005EFEE5 /* AppDelegate.swift */; };
1312 319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19391B4843EB005EFEE5 /* ViewController.swift */; };
1413 319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 319C193B1B4843EB005EFEE5 /* Main.storyboard */; };
1514 319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 319C193E1B4843EB005EFEE5 /* Images.xcassets */; };
1615 319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319C19401B4843EB005EFEE5 /* LaunchScreen.xib */; };
16+ 319C194E1B4843EB005EFEE5 /* GMStepperExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */; };
1717 319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
1818/* End PBXBuildFile section */
1919
2020/* Begin PBXContainerItemProxy section */
21− 3116C0DD1DA4DD360015AC69 /* PBXContainerItemProxy */ = {
21+ 319C19481B4843EB005EFEE5 /* PBXContainerItemProxy */ = {
2222 isa = PBXContainerItemProxy;
2323 containerPortal = 319C192A1B4843EB005EFEE5 /* Project object */;
2424 proxyType = 1;
@@ -28,9 +28,6 @@
2828/* End PBXContainerItemProxy section */
2929
3030/* Begin PBXFileReference section */
31− 3116C0D81DA4DD360015AC69 /* GMStepperExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GMStepperExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
32− 3116C0DA1DA4DD360015AC69 /* GMStepperExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMStepperExampleTests.swift; sourceTree = "<group>"; };
33− 3116C0DC1DA4DD360015AC69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3431 319C19321B4843EB005EFEE5 /* GMStepperExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GMStepperExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
3532 319C19361B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3633 319C19371B4843EB005EFEE5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -38,18 +35,21 @@
3835 319C193C1B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3936 319C193E1B4843EB005EFEE5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
4037 319C19411B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
38+ 319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GMStepperExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
39+ 319C194C1B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
40+ 319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMStepperExampleTests.swift; sourceTree = "<group>"; };
4141 319C195B1B48445E005EFEE5 /* GMStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GMStepper.swift; sourceTree = "<group>"; };
4242/* End PBXFileReference section */
4343
4444/* Begin PBXFrameworksBuildPhase section */
45− 3116C0D51DA4DD360015AC69 /* Frameworks */ = {
45+ 319C192F1B4843EB005EFEE5 /* Frameworks */ = {
4646 isa = PBXFrameworksBuildPhase;
4747 buildActionMask = 2147483647;
4848 files = (
4949 );
5050 runOnlyForDeploymentPostprocessing = 0;
5151 };
52− 319C192F1B4843EB005EFEE5 /* Frameworks */ = {
52+ 319C19441B4843EB005EFEE5 /* Frameworks */ = {
5353 isa = PBXFrameworksBuildPhase;
5454 buildActionMask = 2147483647;
5555 files = (
@@ -59,21 +59,12 @@
5959/* End PBXFrameworksBuildPhase section */
6060
6161/* Begin PBXGroup section */
62− 3116C0D91DA4DD360015AC69 /* GMStepperExampleTests */ = {
63− isa = PBXGroup;
64− children = (
65− 3116C0DA1DA4DD360015AC69 /* GMStepperExampleTests.swift */,
66− 3116C0DC1DA4DD360015AC69 /* Info.plist */,
67− );
68− path = GMStepperExampleTests;
69− sourceTree = "<group>";
70− };
7162 319C19291B4843EB005EFEE5 = {
7263 isa = PBXGroup;
7364 children = (
7465 319C195A1B48445E005EFEE5 /* GMStepper */,
7566 319C19341B4843EB005EFEE5 /* GMStepperExample */,
76− 3116C0D91DA4DD360015AC69 /* GMStepperExampleTests */,
67+ 319C194A1B4843EB005EFEE5 /* GMStepperExampleTests */,
7768 319C19331B4843EB005EFEE5 /* Products */,
7869 );
7970 sourceTree = "<group>";
@@ -82,7 +73,7 @@
8273 isa = PBXGroup;
8374 children = (
8475 319C19321B4843EB005EFEE5 /* GMStepperExample.app */,
85− 3116C0D81DA4DD360015AC69 /* GMStepperExampleTests.xctest */,
76+ 319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */,
8677 );
8778 name = Products;
8879 sourceTree = "<group>";
@@ -108,6 +99,23 @@
10899 name = "Supporting Files";
109100 sourceTree = "<group>";
110101 };
102+ 319C194A1B4843EB005EFEE5 /* GMStepperExampleTests */ = {
103+ isa = PBXGroup;
104+ children = (
105+ 319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */,
106+ 319C194B1B4843EB005EFEE5 /* Supporting Files */,
107+ );
108+ path = GMStepperExampleTests;
109+ sourceTree = "<group>";
110+ };
111+ 319C194B1B4843EB005EFEE5 /* Supporting Files */ = {
112+ isa = PBXGroup;
113+ children = (
114+ 319C194C1B4843EB005EFEE5 /* Info.plist */,
115+ );
116+ name = "Supporting Files";
117+ sourceTree = "<group>";
118+ };
111119 319C195A1B48445E005EFEE5 /* GMStepper */ = {
112120 isa = PBXGroup;
113121 children = (
@@ -120,24 +128,6 @@
120128/* End PBXGroup section */
121129
122130/* Begin PBXNativeTarget section */
123− 3116C0D71DA4DD360015AC69 /* GMStepperExampleTests */ = {
124− isa = PBXNativeTarget;
125− buildConfigurationList = 3116C0DF1DA4DD360015AC69 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */;
126− buildPhases = (
127− 3116C0D41DA4DD360015AC69 /* Sources */,
128− 3116C0D51DA4DD360015AC69 /* Frameworks */,
129− 3116C0D61DA4DD360015AC69 /* Resources */,
130− );
131− buildRules = (
132− );
133− dependencies = (
134− 3116C0DE1DA4DD360015AC69 /* PBXTargetDependency */,
135− );
136− name = GMStepperExampleTests;
137− productName = GMStepperExampleTests;
138− productReference = 3116C0D81DA4DD360015AC69 /* GMStepperExampleTests.xctest */;
139− productType = "com.apple.product-type.bundle.unit-test";
140− };
141131 319C19311B4843EB005EFEE5 /* GMStepperExample */ = {
142132 isa = PBXNativeTarget;
143133 buildConfigurationList = 319C19511B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExample" */;
@@ -155,6 +145,24 @@
155145 productReference = 319C19321B4843EB005EFEE5 /* GMStepperExample.app */;
156146 productType = "com.apple.product-type.application";
157147 };
148+ 319C19461B4843EB005EFEE5 /* GMStepperExampleTests */ = {
149+ isa = PBXNativeTarget;
150+ buildConfigurationList = 319C19541B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */;
151+ buildPhases = (
152+ 319C19431B4843EB005EFEE5 /* Sources */,
153+ 319C19441B4843EB005EFEE5 /* Frameworks */,
154+ 319C19451B4843EB005EFEE5 /* Resources */,
155+ );
156+ buildRules = (
157+ );
158+ dependencies = (
159+ 319C19491B4843EB005EFEE5 /* PBXTargetDependency */,
160+ );
161+ name = GMStepperExampleTests;
162+ productName = GMStepperExampleTests;
163+ productReference = 319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */;
164+ productType = "com.apple.product-type.bundle.unit-test";
165+ };
158166/* End PBXNativeTarget section */
159167
160168/* Begin PBXProject section */
@@ -162,20 +170,20 @@
162170 isa = PBXProject;
163171 attributes = {
164172 LastSwiftMigration = 0700;
165− LastSwiftUpdateCheck = 0800;
166− LastUpgradeCheck = 0900;
173+ LastSwiftUpdateCheck = 0700;
174+ LastUpgradeCheck = 0800;
167175 ORGANIZATIONNAME = "Gunay Mert Karadogan";
168176 TargetAttributes = {
169− 3116C0D71DA4DD360015AC69 = {
170− CreatedOnToolsVersion = 8.0;
171− LastSwiftMigration = 0900;
172− ProvisioningStyle = Automatic;
173− TestTargetID = 319C19311B4843EB005EFEE5;
174− };
175177 319C19311B4843EB005EFEE5 = {
176178 CreatedOnToolsVersion = 6.4;
177179 DevelopmentTeam = 289M6XEDV4;
178− LastSwiftMigration = 0900;
180+ LastSwiftMigration = 0800;
181+ };
182+ 319C19461B4843EB005EFEE5 = {
183+ CreatedOnToolsVersion = 6.4;
184+ DevelopmentTeam = 289M6XEDV4;
185+ LastSwiftMigration = 0800;
186+ TestTargetID = 319C19311B4843EB005EFEE5;
179187 };
180188 };
181189 };
@@ -193,58 +201,58 @@
193201 projectRoot = "";
194202 targets = (
195203 319C19311B4843EB005EFEE5 /* GMStepperExample */,
196− 3116C0D71DA4DD360015AC69 /* GMStepperExampleTests */,
204+ 319C19461B4843EB005EFEE5 /* GMStepperExampleTests */,
197205 );
198206 };
199207/* End PBXProject section */
200208
201209/* Begin PBXResourcesBuildPhase section */
202− 3116C0D61DA4DD360015AC69 /* Resources */ = {
210+ 319C19301B4843EB005EFEE5 /* Resources */ = {
203211 isa = PBXResourcesBuildPhase;
204212 buildActionMask = 2147483647;
205213 files = (
214+ 319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */,
215+ 319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */,
216+ 319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */,
206217 );
207218 runOnlyForDeploymentPostprocessing = 0;
208219 };
209− 319C19301B4843EB005EFEE5 /* Resources */ = {
220+ 319C19451B4843EB005EFEE5 /* Resources */ = {
210221 isa = PBXResourcesBuildPhase;
211222 buildActionMask = 2147483647;
212223 files = (
213− 319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */,
214− 319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */,
215− 319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */,
216224 );
217225 runOnlyForDeploymentPostprocessing = 0;
218226 };
219227/* End PBXResourcesBuildPhase section */
220228
221229/* Begin PBXSourcesBuildPhase section */
222− 3116C0D41DA4DD360015AC69 /* Sources */ = {
230+ 319C192E1B4843EB005EFEE5 /* Sources */ = {
223231 isa = PBXSourcesBuildPhase;
224232 buildActionMask = 2147483647;
225233 files = (
226− 3116C0DB1DA4DD360015AC69 /* GMStepperExampleTests.swift in Sources */,
227− 3198AC771DA4DEE500311FB3 /* GMStepper.swift in Sources */,
234+ 319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */,
235+ 319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */,
236+ 319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */,
228237 );
229238 runOnlyForDeploymentPostprocessing = 0;
230239 };
231− 319C192E1B4843EB005EFEE5 /* Sources */ = {
240+ 319C19431B4843EB005EFEE5 /* Sources */ = {
232241 isa = PBXSourcesBuildPhase;
233242 buildActionMask = 2147483647;
234243 files = (
235− 319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */,
236− 319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */,
237− 319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */,
244+ 319C194E1B4843EB005EFEE5 /* GMStepperExampleTests.swift in Sources */,
245+ 3169DD3E1B496C33009791D1 /* GMStepper.swift in Sources */,
238246 );
239247 runOnlyForDeploymentPostprocessing = 0;
240248 };
241249/* End PBXSourcesBuildPhase section */
242250
243251/* Begin PBXTargetDependency section */
244− 3116C0DE1DA4DD360015AC69 /* PBXTargetDependency */ = {
252+ 319C19491B4843EB005EFEE5 /* PBXTargetDependency */ = {
245253 isa = PBXTargetDependency;
246254 target = 319C19311B4843EB005EFEE5 /* GMStepperExample */;
247− targetProxy = 3116C0DD1DA4DD360015AC69 /* PBXContainerItemProxy */;
255+ targetProxy = 319C19481B4843EB005EFEE5 /* PBXContainerItemProxy */;
248256 };
249257/* End PBXTargetDependency section */
250258
@@ -268,44 +276,6 @@
268276/* End PBXVariantGroup section */
269277
270278/* Begin XCBuildConfiguration section */
271− 3116C0E01DA4DD360015AC69 /* Debug */ = {
272− isa = XCBuildConfiguration;
273− buildSettings = {
274− BUNDLE_LOADER = "$(TEST_HOST)";
275− CLANG_ANALYZER_NONNULL = YES;
276− CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
277− CLANG_WARN_SUSPICIOUS_MOVES = YES;
278− DEBUG_INFORMATION_FORMAT = dwarf;
279− INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
280− IPHONEOS_DEPLOYMENT_TARGET = 10.0;
281− LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
282− PRODUCT_BUNDLE_IDENTIFIER = com.gmertk.GMStepperExampleTests;
283− PRODUCT_NAME = "$(TARGET_NAME)";
284− SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
285− SWIFT_SWIFT3_OBJC_INFERENCE = On;
286− SWIFT_VERSION = 4.0;
287− TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
288− };
289− name = Debug;
290− };
291− 3116C0E11DA4DD360015AC69 /* Release */ = {
292− isa = XCBuildConfiguration;
293− buildSettings = {
294− BUNDLE_LOADER = "$(TEST_HOST)";
295− CLANG_ANALYZER_NONNULL = YES;
296− CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
297− CLANG_WARN_SUSPICIOUS_MOVES = YES;
298− INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
299− IPHONEOS_DEPLOYMENT_TARGET = 10.0;
300− LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
301− PRODUCT_BUNDLE_IDENTIFIER = com.gmertk.GMStepperExampleTests;
302− PRODUCT_NAME = "$(TARGET_NAME)";
303− SWIFT_SWIFT3_OBJC_INFERENCE = On;
304− SWIFT_VERSION = 4.0;
305− TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
306− };
307− name = Release;
308− };
309279 319C194F1B4843EB005EFEE5 /* Debug */ = {
310280 isa = XCBuildConfiguration;
311281 buildSettings = {
@@ -314,20 +284,14 @@
314284 CLANG_CXX_LIBRARY = "libc++";
315285 CLANG_ENABLE_MODULES = YES;
316286 CLANG_ENABLE_OBJC_ARC = YES;
317− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
318287 CLANG_WARN_BOOL_CONVERSION = YES;
319− CLANG_WARN_COMMA = YES;
320288 CLANG_WARN_CONSTANT_CONVERSION = YES;
321289 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
322290 CLANG_WARN_EMPTY_BODY = YES;
323291 CLANG_WARN_ENUM_CONVERSION = YES;
324292 CLANG_WARN_INFINITE_RECURSION = YES;
325293 CLANG_WARN_INT_CONVERSION = YES;
326− CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
327− CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
328294 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329− CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
330− CLANG_WARN_STRICT_PROTOTYPES = YES;
331295 CLANG_WARN_SUSPICIOUS_MOVE = YES;
332296 CLANG_WARN_UNREACHABLE_CODE = YES;
333297 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -367,20 +331,14 @@
367331 CLANG_CXX_LIBRARY = "libc++";
368332 CLANG_ENABLE_MODULES = YES;
369333 CLANG_ENABLE_OBJC_ARC = YES;
370− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
371334 CLANG_WARN_BOOL_CONVERSION = YES;
372− CLANG_WARN_COMMA = YES;
373335 CLANG_WARN_CONSTANT_CONVERSION = YES;
374336 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
375337 CLANG_WARN_EMPTY_BODY = YES;
376338 CLANG_WARN_ENUM_CONVERSION = YES;
377339 CLANG_WARN_INFINITE_RECURSION = YES;
378340 CLANG_WARN_INT_CONVERSION = YES;
379− CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
380− CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
381341 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
382− CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
383− CLANG_WARN_STRICT_PROTOTYPES = YES;
384342 CLANG_WARN_SUSPICIOUS_MOVE = YES;
385343 CLANG_WARN_UNREACHABLE_CODE = YES;
386344 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -414,8 +372,7 @@
414372 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
415373 PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
416374 PRODUCT_NAME = "$(TARGET_NAME)";
417− SWIFT_SWIFT3_OBJC_INFERENCE = Default;
418− SWIFT_VERSION = 4.0;
375+ SWIFT_VERSION = 3.0;
419376 };
420377 name = Debug;
421378 };
@@ -428,23 +385,53 @@
428385 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
429386 PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
430387 PRODUCT_NAME = "$(TARGET_NAME)";
431− SWIFT_SWIFT3_OBJC_INFERENCE = Default;
432− SWIFT_VERSION = 4.0;
388+ SWIFT_VERSION = 3.0;
389+ };
390+ name = Release;
391+ };
392+ 319C19551B4843EB005EFEE5 /* Debug */ = {
393+ isa = XCBuildConfiguration;
394+ buildSettings = {
395+ BUNDLE_LOADER = "$(TEST_HOST)";
396+ DEVELOPMENT_TEAM = 289M6XEDV4;
397+ FRAMEWORK_SEARCH_PATHS = (
398+ "$(SDKROOT)/Developer/Library/Frameworks",
399+ "$(inherited)",
400+ );
401+ GCC_PREPROCESSOR_DEFINITIONS = (
402+ "DEBUG=1",
403+ "$(inherited)",
404+ );
405+ INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
406+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
407+ PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
408+ PRODUCT_NAME = "$(TARGET_NAME)";
409+ SWIFT_VERSION = 3.0;
410+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
411+ };
412+ name = Debug;
413+ };
414+ 319C19561B4843EB005EFEE5 /* Release */ = {
415+ isa = XCBuildConfiguration;
416+ buildSettings = {
417+ BUNDLE_LOADER = "$(TEST_HOST)";
418+ DEVELOPMENT_TEAM = 289M6XEDV4;
419+ FRAMEWORK_SEARCH_PATHS = (
420+ "$(SDKROOT)/Developer/Library/Frameworks",
421+ "$(inherited)",
422+ );
423+ INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
424+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
425+ PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
426+ PRODUCT_NAME = "$(TARGET_NAME)";
427+ SWIFT_VERSION = 3.0;
428+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
433429 };
434430 name = Release;
435431 };
436432/* End XCBuildConfiguration section */
437433
438434/* Begin XCConfigurationList section */
439− 3116C0DF1DA4DD360015AC69 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */ = {
440− isa = XCConfigurationList;
441− buildConfigurations = (
442− 3116C0E01DA4DD360015AC69 /* Debug */,
443− 3116C0E11DA4DD360015AC69 /* Release */,
444− );
445− defaultConfigurationIsVisible = 0;
446− defaultConfigurationName = Release;
447− };
448435 319C192D1B4843EB005EFEE5 /* Build configuration list for PBXProject "GMStepperExample" */ = {
449436 isa = XCConfigurationList;
450437 buildConfigurations = (
@@ -463,6 +450,15 @@
463450 defaultConfigurationIsVisible = 0;
464451 defaultConfigurationName = Release;
465452 };
453+ 319C19541B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */ = {
454+ isa = XCConfigurationList;
455+ buildConfigurations = (
456+ 319C19551B4843EB005EFEE5 /* Debug */,
457+ 319C19561B4843EB005EFEE5 /* Release */,
458+ );
459+ defaultConfigurationIsVisible = 0;
460+ defaultConfigurationName = Release;
461+ };
466462/* End XCConfigurationList section */
467463 };
468464 rootObject = 319C192A1B4843EB005EFEE5 /* Project object */;
GMStepperExample/GMStepperExample/AppDelegate.swift+10−10
@@ -14,33 +14,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414 var window: UIWindow?
1515
1616
17− func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
1818 // Override point for customization after application launch.
1919 return true
2020 }
2121
22− func applicationWillResignActive(_ application: UIApplication) {
22+ func applicationWillResignActive(application: UIApplication) {
2323 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24− // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
24+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
2525 }
2626
27− func applicationDidEnterBackground(_ application: UIApplication) {
27+ func applicationDidEnterBackground(application: UIApplication) {
2828 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
2929 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
3030 }
3131
32− func applicationWillEnterForeground(_ application: UIApplication) {
33− // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
32+ func applicationWillEnterForeground(application: UIApplication) {
33+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
3434 }
3535
36− func applicationDidBecomeActive(_ application: UIApplication) {
36+ func applicationDidBecomeActive(application: UIApplication) {
3737 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
3838 }
3939
40− func applicationWillTerminate(_ application: UIApplication) {
40+ func applicationWillTerminate(application: UIApplication) {
4141 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4242 }
43−
44−
43+
44+
4545}
4646
GMStepperExample/GMStepperExample/Base.lproj/Main.storyboard+34−30
@@ -1,10 +1,9 @@
11<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2−<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
33 <dependencies>
44 <deployment identifier="iOS"/>
5− <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
5+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
66 <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
7− <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
87 </dependencies>
98 <scenes>
109 <!--View Controller-->
@@ -16,11 +15,12 @@
1615 <viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
1716 </layoutGuides>
1817 <view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
19− <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
18+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
2019 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2120 <subviews>
2221 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AU6-4C-B2F" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
23− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
22+ <rect key="frame" x="28" y="28" width="544" height="44"/>
23+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
2424 <constraints>
2525 <constraint firstAttribute="height" constant="44" id="6mC-hP-wFD"/>
2626 </constraints>
@@ -34,26 +34,27 @@
3434 </userDefinedRuntimeAttributes>
3535 </view>
3636 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="if7-U5-bAM" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
37− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
37+ <rect key="frame" x="140" y="116" width="320" height="66"/>
38+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
3839 <constraints>
3940 <constraint firstAttribute="height" constant="66" id="iQi-6P-vt9"/>
4041 <constraint firstAttribute="width" constant="320" id="ji4-Pf-1fZ"/>
4142 </constraints>
4243 <userDefinedRuntimeAttributes>
4344 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
44− <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
45+ <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="calibratedRGB"/>
4546 </userDefinedRuntimeAttribute>
4647 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
47− <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
48+ <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="calibratedRGB"/>
4849 </userDefinedRuntimeAttribute>
4950 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
50− <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
51+ <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
5152 </userDefinedRuntimeAttribute>
5253 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
53− <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
54+ <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
5455 </userDefinedRuntimeAttribute>
5556 <userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
56− <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
57+ <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
5758 </userDefinedRuntimeAttribute>
5859 <userDefinedRuntimeAttribute type="number" keyPath="stepValue">
5960 <real key="value" value="0.5"/>
@@ -61,47 +62,49 @@
6162 </userDefinedRuntimeAttributes>
6263 </view>
6364 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R9n-I0-fq7" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
64− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
65+ <rect key="frame" x="200" y="226" width="200" height="66"/>
66+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
6567 <constraints>
6668 <constraint firstAttribute="width" constant="200" id="dVu-w0-mf0"/>
6769 <constraint firstAttribute="height" constant="66" id="ie8-vl-NAV"/>
6870 </constraints>
6971 <userDefinedRuntimeAttributes>
7072 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
71− <color key="value" red="0.1819814891" green="0.69426733259999995" blue="0.53024792669999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
73+ <color key="value" red="0.1819814891" green="0.69426733259999995" blue="0.53024792669999998" alpha="1" colorSpace="calibratedRGB"/>
7274 </userDefinedRuntimeAttribute>
7375 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
74− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
76+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
7577 </userDefinedRuntimeAttribute>
7678 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
77− <color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
79+ <color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="calibratedRGB"/>
7880 </userDefinedRuntimeAttribute>
7981 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
80− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
82+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
8183 </userDefinedRuntimeAttribute>
8284 <userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
83− <color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
85+ <color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="calibratedRGB"/>
8486 </userDefinedRuntimeAttribute>
8587 </userDefinedRuntimeAttributes>
8688 </view>
8789 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U8X-8Z-7Mo" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
88− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
90+ <rect key="frame" x="28" y="336" width="544" height="44"/>
91+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
8992 <constraints>
9093 <constraint firstAttribute="height" constant="44" id="aF3-T7-dIP"/>
9194 <constraint firstAttribute="width" constant="200" id="vhP-7K-vOu"/>
9295 </constraints>
9396 <userDefinedRuntimeAttributes>
9497 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
95− <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
98+ <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
9699 </userDefinedRuntimeAttribute>
97100 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
98− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
101+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
99102 </userDefinedRuntimeAttribute>
100103 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
101− <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
104+ <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
102105 </userDefinedRuntimeAttribute>
103106 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
104− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
107+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
105108 </userDefinedRuntimeAttribute>
106109 <userDefinedRuntimeAttribute type="number" keyPath="labelWidthWeight">
107110 <real key="value" value="0.69999999999999996"/>
@@ -112,7 +115,7 @@
112115 <integer key="value" value="0"/>
113116 </userDefinedRuntimeAttribute>
114117 <userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
115− <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
118+ <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
116119 </userDefinedRuntimeAttribute>
117120 <userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
118121 <integer key="value" value="100"/>
@@ -125,7 +128,8 @@
125128 </variation>
126129 </view>
127130 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Ri-Yr-sRs" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
128− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
131+ <rect key="frame" x="210" y="424" width="180" height="50"/>
132+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
129133 <constraints>
130134 <constraint firstAttribute="width" constant="180" id="dhO-Nd-SFk"/>
131135 <constraint firstAttribute="height" constant="50" id="xPS-vU-cZc"/>
@@ -144,24 +148,24 @@
144148 <real key="value" value="4"/>
145149 </userDefinedRuntimeAttribute>
146150 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
147− <color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
151+ <color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
148152 </userDefinedRuntimeAttribute>
149153 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
150− <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
154+ <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="calibratedRGB"/>
151155 </userDefinedRuntimeAttribute>
152156 <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
153− <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
157+ <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="calibratedRGB"/>
154158 </userDefinedRuntimeAttribute>
155159 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
156− <color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
160+ <color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
157161 </userDefinedRuntimeAttribute>
158162 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
159− <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
163+ <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="calibratedRGB"/>
160164 </userDefinedRuntimeAttribute>
161165 </userDefinedRuntimeAttributes>
162166 </view>
163167 </subviews>
164− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
168+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
165169 <constraints>
166170 <constraint firstItem="R9n-I0-fq7" firstAttribute="centerX" secondItem="U8X-8Z-7Mo" secondAttribute="centerX" id="3cD-WW-Qg4"/>
167171 <constraint firstItem="if7-U5-bAM" firstAttribute="top" secondItem="AU6-4C-B2F" secondAttribute="bottom" constant="44" id="662-W9-CUn"/>
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}
GMStepperExample/GMStepperExampleTests/GMStepperExampleTests.swift+3−3
@@ -6,8 +6,8 @@
66// Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved.
77//
88
9−import XCTest
109import UIKit
10+import XCTest
1111
1212class GMStepperExampleTests: XCTestCase {
1313 var stepper: GMStepper!
@@ -37,6 +37,6 @@ class GMStepperExampleTests: XCTestCase {
3737
3838 XCTAssert(stepper.value == stepper.maximumValue, "Pass")
3939 }
40−
41−
40+
41+
4242}
GMStepperExample/GMStepperExampleTests/Info.plist+2
@@ -16,6 +16,8 @@
1616 <string>BNDL</string>
1717 <key>CFBundleShortVersionString</key>
1818 <string>1.0</string>
19+ <key>CFBundleSignature</key>
20+ <string>????</string>
1921 <key>CFBundleVersion</key>
2022 <string>1</string>
2123</dict>
README.md+2−7
@@ -5,7 +5,6 @@
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−
98## Screenshot
109
1110![Screenshot_1.gif](https://raw.githubusercontent.com/gmertk/GMStepper/master/Screenshots/screenshot_1.gif)
@@ -69,9 +68,6 @@ var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alph
6968/// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
7069var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)
7170
72−/// Corner radius of the middle label's layer. Defaults to 0.0.
73−var labelCornerRadius: CGFloat = 0.0
74−
7571/// Corner radius of the stepper's layer. Defaults to 4.0.
7672var cornerRadius: CGFloat = 4.0
7773
@@ -89,10 +85,9 @@ var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, al
8985```
9086
9187
92−## Authors
88+## Author
9389
94−* [Brent Whitman](https://github.com/bwhtmn) - Maintainer
95−* [Günay Mert Karadoğan](https://github.com/gmertk) - Creator
90+Günay Mert Karadoğan, mertkaradogan@gmail.com
9691
9792## License
9893