on aa2aa74 help sign in
.gitignore−2
since splitsnapshots
unifiedsplit
@@ -31,5 +31,3 @@ DerivedData
31# Carthage/Checkouts
31# Carthage/Checkouts
32
32
33Carthage/Build
33Carthage/Build
34−
35−.DS_Store
.swift-versiondeleted−1
@@ -1 +0,0 @@
1−4.0
GMStepper.podspec+2−2
@@ -1,9 +1,9 @@
1Pod::Spec.new do |s|
1Pod::Spec.new do |s|
2 s.name = "GMStepper"
2 s.name = "GMStepper"
3− s.version = "2.1"
3+ s.version = "0.1.1"
4 s.summary = "A stepper with a sliding label in the middle."
4 s.summary = "A stepper with a sliding label in the middle."
5 s.homepage = "https://github.com/gmertk/GMStepper"
5 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"
7 s.license = 'MIT'
7 s.license = 'MIT'
8 s.author = { "Gunay Mert Karadogan" => "mertkaradogan@gmail.com" }
8 s.author = { "Gunay Mert Karadogan" => "mertkaradogan@gmail.com" }
9 s.source = { :git => "https://github.com/gmertk/GMStepper.git", :tag => s.version.to_s }
9 s.source = { :git => "https://github.com/gmertk/GMStepper.git", :tag => s.version.to_s }
GMStepper/GMStepper.swift+76−370
@@ -11,79 +11,56 @@ import UIKit
11@IBDesignable public class GMStepper: UIControl {
11@IBDesignable public class GMStepper: UIControl {
12
12
13 /// Current value of the stepper. Defaults to 0.
13 /// Current value of the stepper. Defaults to 0.
14− @objc @IBInspectable public var value: Double = 0 {
14+ public var value = 0 {
15 didSet {
15 didSet {
16 value = min(maximumValue, max(minimumValue, value))
16 value = min(maximumValue, max(minimumValue, value))
17−
18− let isInteger = floor(value) == value
19−
20− //
21− // If we have items, we will display them as steps
22− //
23−
24− if isInteger && stepValue == 1.0 && items.count > 0 {
25− label.text = items[Int(value)]
26− }
27− else if showIntegerIfDoubleIsInteger && isInteger {
28− label.text = String(stringInterpolationSegment: Int(value))
29− } else {
30− label.text = String(stringInterpolationSegment: value)
17+ label.text = String(value)
31− }
32
18
33 if oldValue != value {
19 if oldValue != value {
34− sendActions(for: .valueChanged)
20+ sendActionsForControlEvents(.ValueChanged)
35 }
21 }
36 }
22 }
37 }
23 }
38
24
39 /// Minimum value. Must be less than maximumValue. Defaults to 0.
25 /// Minimum value. Must be less than maximumValue. Defaults to 0.
40− @objc @IBInspectable public var minimumValue: Double = 0 {
26+ @IBInspectable public var minimumValue: Int = 0 {
41 didSet {
27 didSet {
42− value = min(maximumValue, max(minimumValue, value))
28+ value = 0
43 }
29 }
44 }
30 }
45
31
46− /// Maximum value. Must be more than minimumValue. Defaults to 100.
32+ /// Maximum value. Must be more than minimumValue. Defaults to 10.
47− @objc @IBInspectable public var maximumValue: Double = 100 {
33+ @IBInspectable public var maximumValue: Int = 10 {
48 didSet {
34 didSet {
49− value = min(maximumValue, max(minimumValue, value))
35+ value = 0
50 }
36 }
51 }
37 }
52
38
53− /// Step/Increment value as in UIStepper. Defaults to 1.
54− @objc @IBInspectable public var stepValue: Double = 1
55−
56− /// 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
58−
59− /// If the value is integer, it is shown without floating point.
60− @objc @IBInspectable public var showIntegerIfDoubleIsInteger: Bool = true
61−
62− /// Text on the left button. Be sure that it fits in the button. Defaults to "−".
39+ /// Text on the left button. Be sure that it fits in the button. Defaults to "-".
63− @objc @IBInspectable public var leftButtonText: String = "−" {
40+ @IBInspectable public var leftButtonText: String = "-" {
64 didSet {
41 didSet {
65− leftButton.setTitle(leftButtonText, for: .normal)
42+ leftButton.setTitle(leftButtonText, forState: .Normal)
66 }
43 }
67 }
44 }
68
45
69 /// Text on the right button. Be sure that it fits in the button. Defaults to "+".
46 /// Text on the right button. Be sure that it fits in the button. Defaults to "+".
70− @objc @IBInspectable public var rightButtonText: String = "+" {
47+ @IBInspectable public var rightButtonText: String = "+" {
71 didSet {
48 didSet {
72− rightButton.setTitle(rightButtonText, for: .normal)
49+ rightButton.setTitle(rightButtonText, forState: .Normal)
73 }
50 }
74 }
51 }
75
52
76 /// Text color of the buttons. Defaults to white.
53 /// Text color of the buttons. Defaults to white.
77− @objc @IBInspectable public var buttonsTextColor: UIColor = UIColor.white {
54+ @IBInspectable public var buttonsTextColor: UIColor = UIColor.whiteColor() {
78 didSet {
55 didSet {
79 for button in [leftButton, rightButton] {
56 for button in [leftButton, rightButton] {
80− button.setTitleColor(buttonsTextColor, for: .normal)
57+ button.setTitleColor(buttonsTextColor, forState: .Normal)
81 }
58 }
82 }
59 }
83 }
60 }
84
61
85 /// Background color of the buttons. Defaults to dark blue.
62 /// 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) {
63+ @IBInspectable public var buttonsBackgroundColor: UIColor = UIColor(red:0.21, green:0.5, blue:0.74, alpha:1) {
87 didSet {
64 didSet {
88 for button in [leftButton, rightButton] {
65 for button in [leftButton, rightButton] {
89 button.backgroundColor = buttonsBackgroundColor
66 button.backgroundColor = buttonsBackgroundColor
@@ -93,7 +70,7 @@ import UIKit
93 }
70 }
94
71
95 /// Font of the buttons. Defaults to AvenirNext-Bold, 20.0 points in size.
72 /// 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)! {
73+ public var buttonsFont = UIFont(name: "AvenirNext-Bold", size: 20.0)! {
97 didSet {
74 didSet {
98 for button in [leftButton, rightButton] {
75 for button in [leftButton, rightButton] {
99 button.titleLabel?.font = buttonsFont
76 button.titleLabel?.font = buttonsFont
@@ -102,216 +79,95 @@ import UIKit
102 }
79 }
103
80
104 /// Text color of the middle label. Defaults to white.
81 /// Text color of the middle label. Defaults to white.
105− @objc @IBInspectable public var labelTextColor: UIColor = UIColor.white {
82+ @IBInspectable public var labelTextColor: UIColor = UIColor.whiteColor() {
106 didSet {
83 didSet {
107 label.textColor = labelTextColor
84 label.textColor = labelTextColor
108 }
85 }
109 }
86 }
110
87
111 /// Text color of the middle label. Defaults to lighter blue.
88 /// 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) {
89+ @IBInspectable public var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1) {
113 didSet {
90 didSet {
114 label.backgroundColor = labelBackgroundColor
91 label.backgroundColor = labelBackgroundColor
115 }
92 }
116 }
93 }
117
94
118 /// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
95 /// 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)! {
96+ public var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)! {
120 didSet {
97 didSet {
121 label.font = labelFont
98 label.font = labelFont
122 }
99 }
123 }
100 }
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− }
131
101
132 /// Corner radius of the stepper's layer. Defaults to 4.0.
102 /// Corner radius of the stepper's layer. Defaults to 4.0.
133− @objc @IBInspectable public var cornerRadius: CGFloat = 4.0 {
103+ @IBInspectable public var cornerRadius: CGFloat = 4.0 {
134 didSet {
104 didSet {
135 layer.cornerRadius = cornerRadius
105 layer.cornerRadius = cornerRadius
136 clipsToBounds = true
106 clipsToBounds = true
137 }
107 }
138 }
108 }
139−
140− /// Border width of the stepper and middle label's layer. Defaults to 0.0.
141− @objc @IBInspectable public var borderWidth: CGFloat = 0.0 {
142− didSet {
143− layer.borderWidth = borderWidth
144− label.layer.borderWidth = borderWidth
145− }
146− }
147−
148− /// 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 {
150− didSet {
151− layer.borderColor = borderColor.cgColor
152− label.layer.borderColor = borderColor.cgColor
153− }
154− }
155
109
156 /// 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.
110 /// 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 {
111+ @IBInspectable public var labelWidthWeight: CGFloat = 0.5 {
158 didSet {
112 didSet {
159 labelWidthWeight = min(1, max(0, labelWidthWeight))
113 labelWidthWeight = min(1, max(0, labelWidthWeight))
160 setNeedsLayout()
114 setNeedsLayout()
161 }
115 }
162 }
116 }
163
117
164− /// 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)
166−
167 /**
118 /**
168 Width of the sliding animation. When buttons clicked, the middle label does a slide animation towards to the clicked button. Defaults to 5.
119 Width of the sliding animation. When buttons clicked, the middle label does a slide animation towards to the clicked button. Defaults to 5.
169 */
120 */
170− let labelSlideLength: CGFloat = 5
121+ private let labelSlideLength: CGFloat = 5
171
122
172 /// Duration of the sliding animation
123 /// Duration of the sliding animation
173− let labelSlideDuration = TimeInterval(0.1)
124+ private let labelSlideDuration: NSTimeInterval = 0.1
174−
175− /// Duration of the animation when the value hits the limit.
176− let limitHitAnimationDuration = TimeInterval(0.1)
177−
178− lazy var leftButton: UIButton = {
179− let button = UIButton()
180− button.setTitle(self.leftButtonText, for: .normal)
181− button.setTitleColor(self.buttonsTextColor, for: .normal)
182− button.backgroundColor = self.buttonsBackgroundColor
183− button.titleLabel?.font = self.buttonsFont
184− button.addTarget(self, action: #selector(GMStepper.leftButtonTouchDown), for: .touchDown)
185− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
186− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
187− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
188− return button
189− }()
190−
191− lazy var rightButton: UIButton = {
192− let button = UIButton()
193− button.setTitle(self.rightButtonText, for: .normal)
194− button.setTitleColor(self.buttonsTextColor, for: .normal)
195− button.backgroundColor = self.buttonsBackgroundColor
196− button.titleLabel?.font = self.buttonsFont
197− button.addTarget(self, action: #selector(GMStepper.rightButtonTouchDown), for: .touchDown)
198− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
199− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
200− button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
201− return button
202− }()
203−
204− lazy var label: UILabel = {
205− let label = UILabel()
206− label.textAlignment = .center
207− if self.showIntegerIfDoubleIsInteger && floor(self.value) == self.value {
208− label.text = String(stringInterpolationSegment: Int(self.value))
209− } else {
210− label.text = String(stringInterpolationSegment: self.value)
211− }
212− label.textColor = self.labelTextColor
213− label.backgroundColor = self.labelBackgroundColor
214− label.font = self.labelFont
215− label.layer.cornerRadius = self.labelCornerRadius
216− label.layer.masksToBounds = true
217− label.isUserInteractionEnabled = true
218− let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(GMStepper.handlePan))
219− panRecognizer.maximumNumberOfTouches = 1
220− label.addGestureRecognizer(panRecognizer)
221− return label
222− }()
223−
224− var labelOriginalCenter: CGPoint!
225− var labelMaximumCenterX: CGFloat!
226− var labelMinimumCenterX: CGFloat!
227−
228− enum LabelPanState {
229− case Stable, HitRightEdge, HitLeftEdge
230− }
231− var panState = LabelPanState.Stable
232
125
233− enum StepperState {
126+ /// Duration of the flashing animation when the value hits the limit.
234− case Stable, ShouldIncrease, ShouldDecrease
127+ private let limitHitAnimationDuration: NSTimeInterval = 0.1
235− }
236− var stepperState = StepperState.Stable {
237− didSet {
238− if stepperState != .Stable {
239− updateValue()
240− if autorepeat {
241− scheduleTimer()
242− }
243− }
244− }
245− }
246−
247−
248− @objc public var items : [String] = [] {
249− didSet {
250− let isInteger = floor(value) == value
251−
252− //
253− // If we have items, we will display them as steps
254− //
255−
256− if isInteger && stepValue == 1.0 && items.count > 0 {
257−
258− var value = Int(self.value)
259−
260− if value >= items.count {
261− value = items.count - 1
262− self.value = Double(value)
263− }
264− else {
265− label.text = items[value]
266− }
267− }
268− }
269− }
270
128
271− /// Timer used for autorepeat option
129+ /// Color of the flashing animation on the buttons in case the value hit the limit.
272− var timer: Timer?
130+ @IBInspectable public var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
273
131
274− /** When UIStepper reaches its top speed, it alters the value with a time interval of ~0.05 sec.
132+ private let leftButton = UIButton()
275− The user pressing and holding on the stepper repeatedly:
133+ private let rightButton = UIButton()
276− - First 2.5 sec, the stepper changes the value every 0.5 sec.
134+ private let label = UILabel()
277− - For the next 1.5 sec, it changes the value every 0.1 sec.
278− - Then, every 0.05 sec.
279− */
280− let timerInterval = TimeInterval(0.05)
281−
282− /// Check the handleTimerFire: function. While it is counting the number of fires, it decreases the mod value so that the value is altered more frequently.
283− var timerFireCount = 0
284− var timerFireCountModulo: Int {
285− if timerFireCount > 80 {
286− return 1 // 0.05 sec * 1 = 0.05 sec
287− } else if timerFireCount > 50 {
288− return 2 // 0.05 sec * 2 = 0.1 sec
289− } else {
290− return 10 // 0.05 sec * 10 = 0.5 sec
291− }
292− }
293
135
294− @objc required public init?(coder aDecoder: NSCoder) {
136+ required public init(coder aDecoder: NSCoder) {
295 super.init(coder: aDecoder)
137 super.init(coder: aDecoder)
296 setup()
138 setup()
297 }
139 }
298
140
299− @objc public override init(frame: CGRect) {
141+ public override init(frame: CGRect) {
300 super.init(frame: frame)
142 super.init(frame: frame)
301 setup()
143 setup()
302 }
144 }
303
145
304− func setup() {
146+ private func setup() {
147+ leftButton.setTitle(leftButtonText, forState: .Normal)
148+ leftButton.setTitleColor(buttonsTextColor, forState: .Normal)
149+ leftButton.backgroundColor = buttonsBackgroundColor
150+ leftButton.titleLabel?.font = buttonsFont
151+ leftButton.addTarget(self, action: "leftButtonTapped:", forControlEvents: .TouchDown)
305 addSubview(leftButton)
152 addSubview(leftButton)
153+
154+ rightButton.setTitle(rightButtonText, forState: .Normal)
155+ rightButton.setTitleColor(buttonsTextColor, forState: .Normal)
156+ rightButton.backgroundColor = buttonsBackgroundColor
157+ rightButton.titleLabel?.font = buttonsFont
158+ rightButton.addTarget(self, action: "rightButtonTapped:", forControlEvents: .TouchDown)
306 addSubview(rightButton)
159 addSubview(rightButton)
160+
161+ label.textAlignment = .Center
162+ label.text = String(value)
163+ label.textColor = labelTextColor
164+ label.backgroundColor = labelBackgroundColor
165+ label.font = labelFont
307 addSubview(label)
166 addSubview(label)
308
167
309 backgroundColor = buttonsBackgroundColor
168 backgroundColor = buttonsBackgroundColor
310 layer.cornerRadius = cornerRadius
169 layer.cornerRadius = cornerRadius
311 clipsToBounds = true
170 clipsToBounds = true
312− labelOriginalCenter = label.center
313−
314− NotificationCenter.default.addObserver(self, selector: #selector(GMStepper.reset), name: NSNotification.Name.UIApplicationWillResignActive, object: nil)
315 }
171 }
316
172
317 public override func layoutSubviews() {
173 public override func layoutSubviews() {
@@ -321,201 +177,51 @@ import UIKit
321 leftButton.frame = CGRect(x: 0, y: 0, width: buttonWidth, height: bounds.size.height)
177 leftButton.frame = CGRect(x: 0, y: 0, width: buttonWidth, height: bounds.size.height)
322 label.frame = CGRect(x: buttonWidth, y: 0, width: labelWidth, height: bounds.size.height)
178 label.frame = CGRect(x: buttonWidth, y: 0, width: labelWidth, height: bounds.size.height)
323 rightButton.frame = CGRect(x: labelWidth + buttonWidth, y: 0, width: buttonWidth, height: bounds.size.height)
179 rightButton.frame = CGRect(x: labelWidth + buttonWidth, y: 0, width: buttonWidth, height: bounds.size.height)
324−
325− labelMaximumCenterX = label.center.x + labelSlideLength
326− labelMinimumCenterX = label.center.x - labelSlideLength
327− labelOriginalCenter = label.center
328− }
329−
330− func updateValue() {
331− if stepperState == .ShouldIncrease {
332− value += stepValue
333− } else if stepperState == .ShouldDecrease {
334− value -= stepValue
335− }
336− }
337−
338− deinit {
339− resetTimer()
340− NotificationCenter.default.removeObserver(self)
341− }
342−
343− /// Useful closure for logging the timer interval. You can call this in the timer handler to test the autorepeat option. Not used in the current implementation.
344−// lazy var printTimerGaps: () -> () = {
345−// var prevTime: CFAbsoluteTime?
346−//
347−// return { _ in
348−// var now = CFAbsoluteTimeGetCurrent()
349−// if let prevTime = prevTime {
350−// print(now - prevTime)
351−// }
352−// prevTime = now
353−// }
354−// }()
355−}
356−
357−// MARK: Pan Gesture
358−extension GMStepper {
359− @objc func handlePan(gesture: UIPanGestureRecognizer) {
360− switch gesture.state {
361− case .began:
362− leftButton.isEnabled = false
363− rightButton.isEnabled = false
364− case .changed:
365− let translation = gesture.translation(in: label)
366− gesture.setTranslation(CGPoint.zero, in: label)
367−
368− let slidingRight = gesture.velocity(in: label).x > 0
369− let slidingLeft = gesture.velocity(in: label).x < 0
370−
371− // Move the label with pan
372− if slidingRight {
373− label.center.x = min(labelMaximumCenterX, label.center.x + translation.x)
374− } else if slidingLeft {
375− label.center.x = max(labelMinimumCenterX, label.center.x + translation.x)
376− }
377−
378− // When the label hits the edges, increase/decrease value and change button backgrounds
379− if label.center.x == labelMaximumCenterX {
380− // If not hit the right edge before, increase the value and start the timer. If already hit the edge, do nothing. Timer will handle it.
381− if panState != .HitRightEdge {
382− stepperState = .ShouldIncrease
383− panState = .HitRightEdge
384− }
385−
386− animateLimitHitIfNeeded()
387− } else if label.center.x == labelMinimumCenterX {
388− if panState != .HitLeftEdge {
389− stepperState = .ShouldDecrease
390− panState = .HitLeftEdge
391− }
392−
393− animateLimitHitIfNeeded()
394− } else {
395− panState = .Stable
396− stepperState = .Stable
397− resetTimer()
398−
399− self.rightButton.backgroundColor = self.buttonsBackgroundColor
400− self.leftButton.backgroundColor = self.buttonsBackgroundColor
401− }
402− case .ended, .cancelled, .failed:
403− reset()
404− default:
405− break
406− }
407 }
180 }
408
181
409− @objc func reset() {
410− panState = .Stable
411− stepperState = .Stable
412− resetTimer()
413−
414− leftButton.isEnabled = true
415− rightButton.isEnabled = true
416− label.isUserInteractionEnabled = true
417−
418− UIView.animate(withDuration: self.labelSlideDuration, animations: {
419− self.label.center = self.labelOriginalCenter
420− self.rightButton.backgroundColor = self.buttonsBackgroundColor
421− self.leftButton.backgroundColor = self.buttonsBackgroundColor
422− })
423− }
424−}
425−
426−// MARK: Button Events
427−extension GMStepper {
428− @objc func leftButtonTouchDown(button: UIButton) {
182+ @objc private func leftButtonTapped(button: UIButton) {
429− rightButton.isEnabled = false
430− label.isUserInteractionEnabled = false
431− resetTimer()
432−
433 if value == minimumValue {
183 if value == minimumValue {
434− animateLimitHitIfNeeded()
184+ animateLimitHitForButton(leftButton)
435 } else {
185 } else {
436− stepperState = .ShouldDecrease
186+ value -= 1
437 animateSlideLeft()
187 animateSlideLeft()
438 }
188 }
439−
440 }
189 }
441
190
442− @objc func rightButtonTouchDown(button: UIButton) {
191+ @objc private func rightButtonTapped(button: UIButton) {
443− leftButton.isEnabled = false
444− label.isUserInteractionEnabled = false
445− resetTimer()
446−
447 if value == maximumValue {
192 if value == maximumValue {
448− animateLimitHitIfNeeded()
193+ animateLimitHitForButton(rightButton)
449 } else {
194 } else {
450− stepperState = .ShouldIncrease
195+ value += 1
451 animateSlideRight()
196 animateSlideRight()
452 }
197 }
453 }
198 }
454
199
455− @objc func buttonTouchUp(button: UIButton) {
456− reset()
457− }
458−}
459−
460−// MARK: Animations
461−extension GMStepper {
462−
463− func animateSlideLeft() {
200+ private func animateSlideLeft() {
464− UIView.animate(withDuration: labelSlideDuration) {
201+ UIView.animateWithDuration(labelSlideDuration, animations: {
465 self.label.center.x -= self.labelSlideLength
202 self.label.center.x -= self.labelSlideLength
466− }
203+ }, completion: { _ in
204+ UIView.animateWithDuration(self.labelSlideDuration, animations: {
205+ self.label.center.x += self.labelSlideLength
206+ })
207+ })
467 }
208 }
468
209
469− func animateSlideRight() {
210+ private func animateSlideRight() {
470− UIView.animate(withDuration: labelSlideDuration) {
211+ UIView.animateWithDuration(labelSlideDuration, animations: {
471 self.label.center.x += self.labelSlideLength
212 self.label.center.x += self.labelSlideLength
472− }
213+ }, completion: { _ in
473− }
474−
475− func animateToOriginalPosition() {
476− if self.label.center != self.labelOriginalCenter {
477− UIView.animate(withDuration: labelSlideDuration) {
214+ UIView.animateWithDuration(self.labelSlideDuration, animations: {
478− self.label.center = self.labelOriginalCenter
215+ self.label.center.x -= self.labelSlideLength
479− }
216+ })
480− }
217+ })
481− }
482−
483− func animateLimitHitIfNeeded() {
484− if value == minimumValue {
485− animateLimitHitForButton(button: leftButton)
486− } else if value == maximumValue {
487− animateLimitHitForButton(button: rightButton)
488− }
489 }
218 }
490
219
491− func animateLimitHitForButton(button: UIButton){
220+ private func animateLimitHitForButton(button: UIButton){
492− UIView.animate(withDuration: limitHitAnimationDuration) {
221+ UIView.animateWithDuration(limitHitAnimationDuration, animations: {
493 button.backgroundColor = self.limitHitAnimationColor
222 button.backgroundColor = self.limitHitAnimationColor
494− }
223+ }, completion: { _ in
495− }
224+ button.backgroundColor = self.buttonsBackgroundColor
496−}
497−
498−// MARK: Timer
499−extension GMStepper {
500− @objc func handleTimerFire(timer: Timer) {
501− timerFireCount += 1
502−
503− if timerFireCount % timerFireCountModulo == 0 {
504− updateValue()
505− }
506− }
507−
508− func scheduleTimer() {
509− timer = Timer.scheduledTimer(timeInterval: timerInterval, target: self, selector: #selector(GMStepper.handleTimerFire), userInfo: nil, repeats: true)
510− }
511−
512− func resetTimer() {
513− if let timer = timer {
514− timer.invalidate()
515− self.timer = nil
516− timerFireCount = 0
517− }
225+ })
518 }
226 }
519−
520−
521}
227}
GMStepperExample/GMStepperExample.xcodeproj/project.pbxproj+106−136
@@ -7,18 +7,17 @@
7 objects = {
7 objects = {
8
8
9/* Begin PBXBuildFile section */
9/* 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 */; };
12 319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19371B4843EB005EFEE5 /* AppDelegate.swift */; };
10 319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19371B4843EB005EFEE5 /* AppDelegate.swift */; };
13 319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19391B4843EB005EFEE5 /* ViewController.swift */; };
11 319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19391B4843EB005EFEE5 /* ViewController.swift */; };
14 319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 319C193B1B4843EB005EFEE5 /* Main.storyboard */; };
12 319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 319C193B1B4843EB005EFEE5 /* Main.storyboard */; };
15 319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 319C193E1B4843EB005EFEE5 /* Images.xcassets */; };
13 319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 319C193E1B4843EB005EFEE5 /* Images.xcassets */; };
16 319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319C19401B4843EB005EFEE5 /* LaunchScreen.xib */; };
14 319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319C19401B4843EB005EFEE5 /* LaunchScreen.xib */; };
15+ 319C194E1B4843EB005EFEE5 /* GMStepperExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */; };
17 319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
16 319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
18/* End PBXBuildFile section */
17/* End PBXBuildFile section */
19
18
20/* Begin PBXContainerItemProxy section */
19/* Begin PBXContainerItemProxy section */
21− 3116C0DD1DA4DD360015AC69 /* PBXContainerItemProxy */ = {
20+ 319C19481B4843EB005EFEE5 /* PBXContainerItemProxy */ = {
22 isa = PBXContainerItemProxy;
21 isa = PBXContainerItemProxy;
23 containerPortal = 319C192A1B4843EB005EFEE5 /* Project object */;
22 containerPortal = 319C192A1B4843EB005EFEE5 /* Project object */;
24 proxyType = 1;
23 proxyType = 1;
@@ -28,9 +27,6 @@
28/* End PBXContainerItemProxy section */
27/* End PBXContainerItemProxy section */
29
28
30/* Begin PBXFileReference section */
29/* 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>"; };
34 319C19321B4843EB005EFEE5 /* GMStepperExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GMStepperExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
30 319C19321B4843EB005EFEE5 /* GMStepperExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GMStepperExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
35 319C19361B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31 319C19361B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
36 319C19371B4843EB005EFEE5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
32 319C19371B4843EB005EFEE5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -38,18 +34,21 @@
38 319C193C1B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
34 319C193C1B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
39 319C193E1B4843EB005EFEE5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
35 319C193E1B4843EB005EFEE5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
40 319C19411B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
36 319C19411B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
37+ 319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GMStepperExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
38+ 319C194C1B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
39+ 319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMStepperExampleTests.swift; sourceTree = "<group>"; };
41 319C195B1B48445E005EFEE5 /* GMStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GMStepper.swift; sourceTree = "<group>"; };
40 319C195B1B48445E005EFEE5 /* GMStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GMStepper.swift; sourceTree = "<group>"; };
42/* End PBXFileReference section */
41/* End PBXFileReference section */
43
42
44/* Begin PBXFrameworksBuildPhase section */
43/* Begin PBXFrameworksBuildPhase section */
45− 3116C0D51DA4DD360015AC69 /* Frameworks */ = {
44+ 319C192F1B4843EB005EFEE5 /* Frameworks */ = {
46 isa = PBXFrameworksBuildPhase;
45 isa = PBXFrameworksBuildPhase;
47 buildActionMask = 2147483647;
46 buildActionMask = 2147483647;
48 files = (
47 files = (
49 );
48 );
50 runOnlyForDeploymentPostprocessing = 0;
49 runOnlyForDeploymentPostprocessing = 0;
51 };
50 };
52− 319C192F1B4843EB005EFEE5 /* Frameworks */ = {
51+ 319C19441B4843EB005EFEE5 /* Frameworks */ = {
53 isa = PBXFrameworksBuildPhase;
52 isa = PBXFrameworksBuildPhase;
54 buildActionMask = 2147483647;
53 buildActionMask = 2147483647;
55 files = (
54 files = (
@@ -59,21 +58,12 @@
59/* End PBXFrameworksBuildPhase section */
58/* End PBXFrameworksBuildPhase section */
60
59
61/* Begin PBXGroup section */
60/* 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− };
71 319C19291B4843EB005EFEE5 = {
61 319C19291B4843EB005EFEE5 = {
72 isa = PBXGroup;
62 isa = PBXGroup;
73 children = (
63 children = (
74 319C195A1B48445E005EFEE5 /* GMStepper */,
64 319C195A1B48445E005EFEE5 /* GMStepper */,
75 319C19341B4843EB005EFEE5 /* GMStepperExample */,
65 319C19341B4843EB005EFEE5 /* GMStepperExample */,
76− 3116C0D91DA4DD360015AC69 /* GMStepperExampleTests */,
66+ 319C194A1B4843EB005EFEE5 /* GMStepperExampleTests */,
77 319C19331B4843EB005EFEE5 /* Products */,
67 319C19331B4843EB005EFEE5 /* Products */,
78 );
68 );
79 sourceTree = "<group>";
69 sourceTree = "<group>";
@@ -82,7 +72,7 @@
82 isa = PBXGroup;
72 isa = PBXGroup;
83 children = (
73 children = (
84 319C19321B4843EB005EFEE5 /* GMStepperExample.app */,
74 319C19321B4843EB005EFEE5 /* GMStepperExample.app */,
85− 3116C0D81DA4DD360015AC69 /* GMStepperExampleTests.xctest */,
75+ 319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */,
86 );
76 );
87 name = Products;
77 name = Products;
88 sourceTree = "<group>";
78 sourceTree = "<group>";
@@ -108,6 +98,23 @@
108 name = "Supporting Files";
98 name = "Supporting Files";
109 sourceTree = "<group>";
99 sourceTree = "<group>";
110 };
100 };
101+ 319C194A1B4843EB005EFEE5 /* GMStepperExampleTests */ = {
102+ isa = PBXGroup;
103+ children = (
104+ 319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */,
105+ 319C194B1B4843EB005EFEE5 /* Supporting Files */,
106+ );
107+ path = GMStepperExampleTests;
108+ sourceTree = "<group>";
109+ };
110+ 319C194B1B4843EB005EFEE5 /* Supporting Files */ = {
111+ isa = PBXGroup;
112+ children = (
113+ 319C194C1B4843EB005EFEE5 /* Info.plist */,
114+ );
115+ name = "Supporting Files";
116+ sourceTree = "<group>";
117+ };
111 319C195A1B48445E005EFEE5 /* GMStepper */ = {
118 319C195A1B48445E005EFEE5 /* GMStepper */ = {
112 isa = PBXGroup;
119 isa = PBXGroup;
113 children = (
120 children = (
@@ -120,24 +127,6 @@
120/* End PBXGroup section */
127/* End PBXGroup section */
121
128
122/* Begin PBXNativeTarget section */
129/* 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− };
141 319C19311B4843EB005EFEE5 /* GMStepperExample */ = {
130 319C19311B4843EB005EFEE5 /* GMStepperExample */ = {
142 isa = PBXNativeTarget;
131 isa = PBXNativeTarget;
143 buildConfigurationList = 319C19511B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExample" */;
132 buildConfigurationList = 319C19511B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExample" */;
@@ -155,27 +144,39 @@
155 productReference = 319C19321B4843EB005EFEE5 /* GMStepperExample.app */;
144 productReference = 319C19321B4843EB005EFEE5 /* GMStepperExample.app */;
156 productType = "com.apple.product-type.application";
145 productType = "com.apple.product-type.application";
157 };
146 };
147+ 319C19461B4843EB005EFEE5 /* GMStepperExampleTests */ = {
148+ isa = PBXNativeTarget;
149+ buildConfigurationList = 319C19541B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */;
150+ buildPhases = (
151+ 319C19431B4843EB005EFEE5 /* Sources */,
152+ 319C19441B4843EB005EFEE5 /* Frameworks */,
153+ 319C19451B4843EB005EFEE5 /* Resources */,
154+ );
155+ buildRules = (
156+ );
157+ dependencies = (
158+ 319C19491B4843EB005EFEE5 /* PBXTargetDependency */,
159+ );
160+ name = GMStepperExampleTests;
161+ productName = GMStepperExampleTests;
162+ productReference = 319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */;
163+ productType = "com.apple.product-type.bundle.unit-test";
164+ };
158/* End PBXNativeTarget section */
165/* End PBXNativeTarget section */
159
166
160/* Begin PBXProject section */
167/* Begin PBXProject section */
161 319C192A1B4843EB005EFEE5 /* Project object */ = {
168 319C192A1B4843EB005EFEE5 /* Project object */ = {
162 isa = PBXProject;
169 isa = PBXProject;
163 attributes = {
170 attributes = {
164− LastSwiftMigration = 0700;
165− LastSwiftUpdateCheck = 0800;
166− LastUpgradeCheck = 0900;
171+ LastUpgradeCheck = 0640;
167 ORGANIZATIONNAME = "Gunay Mert Karadogan";
172 ORGANIZATIONNAME = "Gunay Mert Karadogan";
168 TargetAttributes = {
173 TargetAttributes = {
169− 3116C0D71DA4DD360015AC69 = {
170− CreatedOnToolsVersion = 8.0;
171− LastSwiftMigration = 0900;
172− ProvisioningStyle = Automatic;
173− TestTargetID = 319C19311B4843EB005EFEE5;
174− };
175 319C19311B4843EB005EFEE5 = {
174 319C19311B4843EB005EFEE5 = {
176 CreatedOnToolsVersion = 6.4;
175 CreatedOnToolsVersion = 6.4;
177− DevelopmentTeam = 289M6XEDV4;
176+ };
178− LastSwiftMigration = 0900;
177+ 319C19461B4843EB005EFEE5 = {
178+ CreatedOnToolsVersion = 6.4;
179+ TestTargetID = 319C19311B4843EB005EFEE5;
179 };
180 };
180 };
181 };
181 };
182 };
@@ -193,58 +194,57 @@
193 projectRoot = "";
194 projectRoot = "";
194 targets = (
195 targets = (
195 319C19311B4843EB005EFEE5 /* GMStepperExample */,
196 319C19311B4843EB005EFEE5 /* GMStepperExample */,
196− 3116C0D71DA4DD360015AC69 /* GMStepperExampleTests */,
197+ 319C19461B4843EB005EFEE5 /* GMStepperExampleTests */,
197 );
198 );
198 };
199 };
199/* End PBXProject section */
200/* End PBXProject section */
200
201
201/* Begin PBXResourcesBuildPhase section */
202/* Begin PBXResourcesBuildPhase section */
202− 3116C0D61DA4DD360015AC69 /* Resources */ = {
203+ 319C19301B4843EB005EFEE5 /* Resources */ = {
203 isa = PBXResourcesBuildPhase;
204 isa = PBXResourcesBuildPhase;
204 buildActionMask = 2147483647;
205 buildActionMask = 2147483647;
205 files = (
206 files = (
207+ 319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */,
208+ 319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */,
209+ 319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */,
206 );
210 );
207 runOnlyForDeploymentPostprocessing = 0;
211 runOnlyForDeploymentPostprocessing = 0;
208 };
212 };
209− 319C19301B4843EB005EFEE5 /* Resources */ = {
213+ 319C19451B4843EB005EFEE5 /* Resources */ = {
210 isa = PBXResourcesBuildPhase;
214 isa = PBXResourcesBuildPhase;
211 buildActionMask = 2147483647;
215 buildActionMask = 2147483647;
212 files = (
216 files = (
213− 319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */,
214− 319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */,
215− 319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */,
216 );
217 );
217 runOnlyForDeploymentPostprocessing = 0;
218 runOnlyForDeploymentPostprocessing = 0;
218 };
219 };
219/* End PBXResourcesBuildPhase section */
220/* End PBXResourcesBuildPhase section */
220
221
221/* Begin PBXSourcesBuildPhase section */
222/* Begin PBXSourcesBuildPhase section */
222− 3116C0D41DA4DD360015AC69 /* Sources */ = {
223+ 319C192E1B4843EB005EFEE5 /* Sources */ = {
223 isa = PBXSourcesBuildPhase;
224 isa = PBXSourcesBuildPhase;
224 buildActionMask = 2147483647;
225 buildActionMask = 2147483647;
225 files = (
226 files = (
226− 3116C0DB1DA4DD360015AC69 /* GMStepperExampleTests.swift in Sources */,
227+ 319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */,
227− 3198AC771DA4DEE500311FB3 /* GMStepper.swift in Sources */,
228+ 319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */,
229+ 319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */,
228 );
230 );
229 runOnlyForDeploymentPostprocessing = 0;
231 runOnlyForDeploymentPostprocessing = 0;
230 };
232 };
231− 319C192E1B4843EB005EFEE5 /* Sources */ = {
233+ 319C19431B4843EB005EFEE5 /* Sources */ = {
232 isa = PBXSourcesBuildPhase;
234 isa = PBXSourcesBuildPhase;
233 buildActionMask = 2147483647;
235 buildActionMask = 2147483647;
234 files = (
236 files = (
235− 319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */,
237+ 319C194E1B4843EB005EFEE5 /* GMStepperExampleTests.swift in Sources */,
236− 319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */,
237− 319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */,
238 );
238 );
239 runOnlyForDeploymentPostprocessing = 0;
239 runOnlyForDeploymentPostprocessing = 0;
240 };
240 };
241/* End PBXSourcesBuildPhase section */
241/* End PBXSourcesBuildPhase section */
242
242
243/* Begin PBXTargetDependency section */
243/* Begin PBXTargetDependency section */
244− 3116C0DE1DA4DD360015AC69 /* PBXTargetDependency */ = {
244+ 319C19491B4843EB005EFEE5 /* PBXTargetDependency */ = {
245 isa = PBXTargetDependency;
245 isa = PBXTargetDependency;
246 target = 319C19311B4843EB005EFEE5 /* GMStepperExample */;
246 target = 319C19311B4843EB005EFEE5 /* GMStepperExample */;
247− targetProxy = 3116C0DD1DA4DD360015AC69 /* PBXContainerItemProxy */;
247+ targetProxy = 319C19481B4843EB005EFEE5 /* PBXContainerItemProxy */;
248 };
248 };
249/* End PBXTargetDependency section */
249/* End PBXTargetDependency section */
250
250
@@ -268,44 +268,6 @@
268/* End PBXVariantGroup section */
268/* End PBXVariantGroup section */
269
269
270/* Begin XCBuildConfiguration section */
270/* 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− };
309 319C194F1B4843EB005EFEE5 /* Debug */ = {
271 319C194F1B4843EB005EFEE5 /* Debug */ = {
310 isa = XCBuildConfiguration;
272 isa = XCBuildConfiguration;
311 buildSettings = {
273 buildSettings = {
@@ -314,28 +276,19 @@
314 CLANG_CXX_LIBRARY = "libc++";
276 CLANG_CXX_LIBRARY = "libc++";
315 CLANG_ENABLE_MODULES = YES;
277 CLANG_ENABLE_MODULES = YES;
316 CLANG_ENABLE_OBJC_ARC = YES;
278 CLANG_ENABLE_OBJC_ARC = YES;
317− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
318 CLANG_WARN_BOOL_CONVERSION = YES;
279 CLANG_WARN_BOOL_CONVERSION = YES;
319− CLANG_WARN_COMMA = YES;
320 CLANG_WARN_CONSTANT_CONVERSION = YES;
280 CLANG_WARN_CONSTANT_CONVERSION = YES;
321 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
281 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
322 CLANG_WARN_EMPTY_BODY = YES;
282 CLANG_WARN_EMPTY_BODY = YES;
323 CLANG_WARN_ENUM_CONVERSION = YES;
283 CLANG_WARN_ENUM_CONVERSION = YES;
324− CLANG_WARN_INFINITE_RECURSION = YES;
325 CLANG_WARN_INT_CONVERSION = YES;
284 CLANG_WARN_INT_CONVERSION = YES;
326− CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
327− CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
328 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
285 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329− CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
330− CLANG_WARN_STRICT_PROTOTYPES = YES;
331− CLANG_WARN_SUSPICIOUS_MOVE = YES;
332 CLANG_WARN_UNREACHABLE_CODE = YES;
286 CLANG_WARN_UNREACHABLE_CODE = YES;
333 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
287 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
334 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
288 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
335 COPY_PHASE_STRIP = NO;
289 COPY_PHASE_STRIP = NO;
336 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
290 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
337 ENABLE_STRICT_OBJC_MSGSEND = YES;
291 ENABLE_STRICT_OBJC_MSGSEND = YES;
338− ENABLE_TESTABILITY = YES;
339 GCC_C_LANGUAGE_STANDARD = gnu99;
292 GCC_C_LANGUAGE_STANDARD = gnu99;
340 GCC_DYNAMIC_NO_PIC = NO;
293 GCC_DYNAMIC_NO_PIC = NO;
341 GCC_NO_COMMON_BLOCKS = YES;
294 GCC_NO_COMMON_BLOCKS = YES;
@@ -367,21 +320,13 @@
367 CLANG_CXX_LIBRARY = "libc++";
320 CLANG_CXX_LIBRARY = "libc++";
368 CLANG_ENABLE_MODULES = YES;
321 CLANG_ENABLE_MODULES = YES;
369 CLANG_ENABLE_OBJC_ARC = YES;
322 CLANG_ENABLE_OBJC_ARC = YES;
370− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
371 CLANG_WARN_BOOL_CONVERSION = YES;
323 CLANG_WARN_BOOL_CONVERSION = YES;
372− CLANG_WARN_COMMA = YES;
373 CLANG_WARN_CONSTANT_CONVERSION = YES;
324 CLANG_WARN_CONSTANT_CONVERSION = YES;
374 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
325 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
375 CLANG_WARN_EMPTY_BODY = YES;
326 CLANG_WARN_EMPTY_BODY = YES;
376 CLANG_WARN_ENUM_CONVERSION = YES;
327 CLANG_WARN_ENUM_CONVERSION = YES;
377− CLANG_WARN_INFINITE_RECURSION = YES;
378 CLANG_WARN_INT_CONVERSION = YES;
328 CLANG_WARN_INT_CONVERSION = YES;
379− CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
380− CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
381 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
382− CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
383− CLANG_WARN_STRICT_PROTOTYPES = YES;
384− CLANG_WARN_SUSPICIOUS_MOVE = YES;
385 CLANG_WARN_UNREACHABLE_CODE = YES;
330 CLANG_WARN_UNREACHABLE_CODE = YES;
386 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
331 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
387 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
332 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -400,7 +345,6 @@
400 IPHONEOS_DEPLOYMENT_TARGET = 8.4;
345 IPHONEOS_DEPLOYMENT_TARGET = 8.4;
401 MTL_ENABLE_DEBUG_INFO = NO;
346 MTL_ENABLE_DEBUG_INFO = NO;
402 SDKROOT = iphoneos;
347 SDKROOT = iphoneos;
403− SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
404 VALIDATE_PRODUCT = YES;
348 VALIDATE_PRODUCT = YES;
405 };
349 };
406 name = Release;
350 name = Release;
@@ -409,13 +353,9 @@
409 isa = XCBuildConfiguration;
353 isa = XCBuildConfiguration;
410 buildSettings = {
354 buildSettings = {
411 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
355 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
412− DEVELOPMENT_TEAM = 289M6XEDV4;
413 INFOPLIST_FILE = GMStepperExample/Info.plist;
356 INFOPLIST_FILE = GMStepperExample/Info.plist;
414 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
357 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
415− PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
416 PRODUCT_NAME = "$(TARGET_NAME)";
358 PRODUCT_NAME = "$(TARGET_NAME)";
417− SWIFT_SWIFT3_OBJC_INFERENCE = Default;
418− SWIFT_VERSION = 4.0;
419 };
359 };
420 name = Debug;
360 name = Debug;
421 };
361 };
@@ -423,28 +363,49 @@
423 isa = XCBuildConfiguration;
363 isa = XCBuildConfiguration;
424 buildSettings = {
364 buildSettings = {
425 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
365 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
426− DEVELOPMENT_TEAM = 289M6XEDV4;
427 INFOPLIST_FILE = GMStepperExample/Info.plist;
366 INFOPLIST_FILE = GMStepperExample/Info.plist;
428 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
367 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
429− PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
430 PRODUCT_NAME = "$(TARGET_NAME)";
368 PRODUCT_NAME = "$(TARGET_NAME)";
431− SWIFT_SWIFT3_OBJC_INFERENCE = Default;
369+ };
432− SWIFT_VERSION = 4.0;
370+ name = Release;
371+ };
372+ 319C19551B4843EB005EFEE5 /* Debug */ = {
373+ isa = XCBuildConfiguration;
374+ buildSettings = {
375+ BUNDLE_LOADER = "$(TEST_HOST)";
376+ FRAMEWORK_SEARCH_PATHS = (
377+ "$(SDKROOT)/Developer/Library/Frameworks",
378+ "$(inherited)",
379+ );
380+ GCC_PREPROCESSOR_DEFINITIONS = (
381+ "DEBUG=1",
382+ "$(inherited)",
383+ );
384+ INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
385+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
386+ PRODUCT_NAME = "$(TARGET_NAME)";
387+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
388+ };
389+ name = Debug;
390+ };
391+ 319C19561B4843EB005EFEE5 /* Release */ = {
392+ isa = XCBuildConfiguration;
393+ buildSettings = {
394+ BUNDLE_LOADER = "$(TEST_HOST)";
395+ FRAMEWORK_SEARCH_PATHS = (
396+ "$(SDKROOT)/Developer/Library/Frameworks",
397+ "$(inherited)",
398+ );
399+ INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
400+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
401+ PRODUCT_NAME = "$(TARGET_NAME)";
402+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
433 };
403 };
434 name = Release;
404 name = Release;
435 };
405 };
436/* End XCBuildConfiguration section */
406/* End XCBuildConfiguration section */
437
407
438/* Begin XCConfigurationList section */
408/* 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− };
448 319C192D1B4843EB005EFEE5 /* Build configuration list for PBXProject "GMStepperExample" */ = {
409 319C192D1B4843EB005EFEE5 /* Build configuration list for PBXProject "GMStepperExample" */ = {
449 isa = XCConfigurationList;
410 isa = XCConfigurationList;
450 buildConfigurations = (
411 buildConfigurations = (
@@ -463,6 +424,15 @@
463 defaultConfigurationIsVisible = 0;
424 defaultConfigurationIsVisible = 0;
464 defaultConfigurationName = Release;
425 defaultConfigurationName = Release;
465 };
426 };
427+ 319C19541B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */ = {
428+ isa = XCConfigurationList;
429+ buildConfigurations = (
430+ 319C19551B4843EB005EFEE5 /* Debug */,
431+ 319C19561B4843EB005EFEE5 /* Release */,
432+ );
433+ defaultConfigurationIsVisible = 0;
434+ defaultConfigurationName = Release;
435+ };
466/* End XCConfigurationList section */
436/* End XCConfigurationList section */
467 };
437 };
468 rootObject = 319C192A1B4843EB005EFEE5 /* Project object */;
438 rootObject = 319C192A1B4843EB005EFEE5 /* Project object */;
GMStepperExample/GMStepperExample/AppDelegate.swift+10−10
@@ -14,33 +14,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
14 var window: UIWindow?
14 var window: UIWindow?
15
15
16
16
17− func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 // Override point for customization after application launch.
18 // Override point for customization after application launch.
19 return true
19 return true
20 }
20 }
21
21
22− func applicationWillResignActive(_ application: UIApplication) {
22+ func applicationWillResignActive(application: UIApplication) {
23 // 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.
23 // 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.
25 }
25 }
26
26
27− func applicationDidEnterBackground(_ application: UIApplication) {
27+ func applicationDidEnterBackground(application: UIApplication) {
28 // 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.
28 // 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.
29 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 }
30 }
31
31
32− func applicationWillEnterForeground(_ application: UIApplication) {
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.
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.
34 }
34 }
35
35
36− func applicationDidBecomeActive(_ application: UIApplication) {
36+ func applicationDidBecomeActive(application: UIApplication) {
37 // 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.
37 // 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.
38 }
38 }
39
39
40− func applicationWillTerminate(_ application: UIApplication) {
40+ func applicationWillTerminate(application: UIApplication) {
41 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
41 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 }
42 }
43−
43+
44−
44+
45}
45}
46
46
GMStepperExample/GMStepperExample/Base.lproj/LaunchScreen.xib+2−6
@@ -1,8 +1,7 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2−<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="15A279b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
3 <dependencies>
3 <dependencies>
4− <deployment identifier="iOS"/>
5− <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
4+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
6 <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
5 <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
7 </dependencies>
6 </dependencies>
8 <objects>
7 <objects>
@@ -14,20 +13,17 @@
14 <subviews>
13 <subviews>
15 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
14 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
16 <rect key="frame" x="20" y="439" width="441" height="21"/>
15 <rect key="frame" x="20" y="439" width="441" height="21"/>
17− <animations/>
18 <fontDescription key="fontDescription" type="system" pointSize="17"/>
16 <fontDescription key="fontDescription" type="system" pointSize="17"/>
19 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
17 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
20 <nil key="highlightedColor"/>
18 <nil key="highlightedColor"/>
21 </label>
19 </label>
22 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GMStepperExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
20 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GMStepperExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
23 <rect key="frame" x="20" y="140" width="441" height="43"/>
21 <rect key="frame" x="20" y="140" width="441" height="43"/>
24− <animations/>
25 <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
22 <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
26 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
23 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
27 <nil key="highlightedColor"/>
24 <nil key="highlightedColor"/>
28 </label>
25 </label>
29 </subviews>
26 </subviews>
30− <animations/>
31 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
27 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
32 <constraints>
28 <constraints>
33 <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
29 <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
GMStepperExample/GMStepperExample/Base.lproj/Main.storyboard+39−79
@@ -1,10 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1<?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="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
3 <dependencies>
3 <dependencies>
4− <deployment identifier="iOS"/>
5− <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
4+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
6 <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
5 <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
7− <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8 </dependencies>
6 </dependencies>
9 <scenes>
7 <scenes>
10 <!--View Controller-->
8 <!--View Controller-->
@@ -16,92 +14,96 @@
16 <viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
14 <viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
17 </layoutGuides>
15 </layoutGuides>
18 <view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
16 <view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
19− <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
17+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
20 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
18 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
21 <subviews>
19 <subviews>
22 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AU6-4C-B2F" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
20 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AU6-4C-B2F" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
21+ <rect key="frame" x="24" y="28" width="552" height="44"/>
23− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
22+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
24 <constraints>
23 <constraints>
25 <constraint firstAttribute="height" constant="44" id="6mC-hP-wFD"/>
24 <constraint firstAttribute="height" constant="44" id="6mC-hP-wFD"/>
26 </constraints>
25 </constraints>
27 <userDefinedRuntimeAttributes>
26 <userDefinedRuntimeAttributes>
28− <userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
27+ <userDefinedRuntimeAttribute type="number" keyPath="minimumValue">
29− <real key="value" value="25"/>
30− </userDefinedRuntimeAttribute>
31− <userDefinedRuntimeAttribute type="number" keyPath="stepValue">
32− <real key="value" value="5"/>
28+ <integer key="value" value="1"/>
33 </userDefinedRuntimeAttribute>
29 </userDefinedRuntimeAttribute>
34 </userDefinedRuntimeAttributes>
30 </userDefinedRuntimeAttributes>
35 </view>
31 </view>
36 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="if7-U5-bAM" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
32 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="if7-U5-bAM" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
33+ <rect key="frame" x="140" y="116" width="320" height="66"/>
37− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
34+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
38 <constraints>
35 <constraints>
39 <constraint firstAttribute="height" constant="66" id="iQi-6P-vt9"/>
36 <constraint firstAttribute="height" constant="66" id="iQi-6P-vt9"/>
40 <constraint firstAttribute="width" constant="320" id="ji4-Pf-1fZ"/>
37 <constraint firstAttribute="width" constant="320" id="ji4-Pf-1fZ"/>
41 </constraints>
38 </constraints>
42 <userDefinedRuntimeAttributes>
39 <userDefinedRuntimeAttributes>
40+ <userDefinedRuntimeAttribute type="number" keyPath="minimumValue">
41+ <integer key="value" value="7"/>
42+ </userDefinedRuntimeAttribute>
43+ <userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
44+ <integer key="value" value="10"/>
45+ </userDefinedRuntimeAttribute>
43 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
46 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
44− <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
47+ <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="calibratedRGB"/>
45 </userDefinedRuntimeAttribute>
48 </userDefinedRuntimeAttribute>
46 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
49 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
47− <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
50+ <color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="calibratedRGB"/>
48 </userDefinedRuntimeAttribute>
51 </userDefinedRuntimeAttribute>
49 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
52 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
50− <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
53+ <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
51 </userDefinedRuntimeAttribute>
54 </userDefinedRuntimeAttribute>
52 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
55 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
53− <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
56+ <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
54− </userDefinedRuntimeAttribute>
55− <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− </userDefinedRuntimeAttribute>
58− <userDefinedRuntimeAttribute type="number" keyPath="stepValue">
59− <real key="value" value="0.5"/>
60 </userDefinedRuntimeAttribute>
57 </userDefinedRuntimeAttribute>
61 </userDefinedRuntimeAttributes>
58 </userDefinedRuntimeAttributes>
62 </view>
59 </view>
63 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R9n-I0-fq7" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
60 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R9n-I0-fq7" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
61+ <rect key="frame" x="200" y="226" width="200" height="66"/>
64− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
62+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
65 <constraints>
63 <constraints>
66 <constraint firstAttribute="width" constant="200" id="dVu-w0-mf0"/>
64 <constraint firstAttribute="width" constant="200" id="dVu-w0-mf0"/>
67 <constraint firstAttribute="height" constant="66" id="ie8-vl-NAV"/>
65 <constraint firstAttribute="height" constant="66" id="ie8-vl-NAV"/>
68 </constraints>
66 </constraints>
69 <userDefinedRuntimeAttributes>
67 <userDefinedRuntimeAttributes>
70 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
68 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
71− <color key="value" red="0.1819814891" green="0.69426733259999995" blue="0.53024792669999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
69+ <color key="value" red="0.1819814891" green="0.69426733259999995" blue="0.53024792669999998" alpha="1" colorSpace="calibratedRGB"/>
72 </userDefinedRuntimeAttribute>
70 </userDefinedRuntimeAttribute>
73 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
71 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
74− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
72+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
75 </userDefinedRuntimeAttribute>
73 </userDefinedRuntimeAttribute>
76 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
74 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
77− <color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
75+ <color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="calibratedRGB"/>
78 </userDefinedRuntimeAttribute>
76 </userDefinedRuntimeAttribute>
79 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
77 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
80− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
78+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
81 </userDefinedRuntimeAttribute>
79 </userDefinedRuntimeAttribute>
82− <userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
80+ <userDefinedRuntimeAttribute type="number" keyPath="minimumValue">
83− <color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
81+ <integer key="value" value="9"/>
82+ </userDefinedRuntimeAttribute>
83+ <userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
84+ <integer key="value" value="13"/>
84 </userDefinedRuntimeAttribute>
85 </userDefinedRuntimeAttribute>
85 </userDefinedRuntimeAttributes>
86 </userDefinedRuntimeAttributes>
86 </view>
87 </view>
87 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U8X-8Z-7Mo" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
88 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U8X-8Z-7Mo" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
89+ <rect key="frame" x="24" y="336" width="552" height="44"/>
88− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
90+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
89 <constraints>
91 <constraints>
90 <constraint firstAttribute="height" constant="44" id="aF3-T7-dIP"/>
92 <constraint firstAttribute="height" constant="44" id="aF3-T7-dIP"/>
91 <constraint firstAttribute="width" constant="200" id="vhP-7K-vOu"/>
93 <constraint firstAttribute="width" constant="200" id="vhP-7K-vOu"/>
92 </constraints>
94 </constraints>
93 <userDefinedRuntimeAttributes>
95 <userDefinedRuntimeAttributes>
94 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
96 <userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
95− <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
97+ <color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
96 </userDefinedRuntimeAttribute>
98 </userDefinedRuntimeAttribute>
97 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
99 <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
98− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
100+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
99 </userDefinedRuntimeAttribute>
101 </userDefinedRuntimeAttribute>
100 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
102 <userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
101− <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
103+ <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
102 </userDefinedRuntimeAttribute>
104 </userDefinedRuntimeAttribute>
103 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
105 <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
104− <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
106+ <color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
105 </userDefinedRuntimeAttribute>
107 </userDefinedRuntimeAttribute>
106 <userDefinedRuntimeAttribute type="number" keyPath="labelWidthWeight">
108 <userDefinedRuntimeAttribute type="number" keyPath="labelWidthWeight">
107 <real key="value" value="0.69999999999999996"/>
109 <real key="value" value="0.69999999999999996"/>
@@ -109,13 +111,10 @@
109 <userDefinedRuntimeAttribute type="string" keyPath="leftButtonText" value="😞"/>
111 <userDefinedRuntimeAttribute type="string" keyPath="leftButtonText" value="😞"/>
110 <userDefinedRuntimeAttribute type="string" keyPath="rightButtonText" value="☺️"/>
112 <userDefinedRuntimeAttribute type="string" keyPath="rightButtonText" value="☺️"/>
111 <userDefinedRuntimeAttribute type="number" keyPath="minimumValue">
113 <userDefinedRuntimeAttribute type="number" keyPath="minimumValue">
112− <integer key="value" value="0"/>
114+ <integer key="value" value="5"/>
113 </userDefinedRuntimeAttribute>
115 </userDefinedRuntimeAttribute>
114 <userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
116 <userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
115− <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
117+ <color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
116− </userDefinedRuntimeAttribute>
117− <userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
118− <integer key="value" value="100"/>
119 </userDefinedRuntimeAttribute>
118 </userDefinedRuntimeAttribute>
120 </userDefinedRuntimeAttributes>
119 </userDefinedRuntimeAttributes>
121 <variation key="default">
120 <variation key="default">
@@ -124,44 +123,8 @@
124 </mask>
123 </mask>
125 </variation>
124 </variation>
126 </view>
125 </view>
127− <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"/>
129− <constraints>
130− <constraint firstAttribute="width" constant="180" id="dhO-Nd-SFk"/>
131− <constraint firstAttribute="height" constant="50" id="xPS-vU-cZc"/>
132− </constraints>
133− <userDefinedRuntimeAttributes>
134− <userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
135− <real key="value" value="10"/>
136− </userDefinedRuntimeAttribute>
137− <userDefinedRuntimeAttribute type="number" keyPath="stepValue">
138− <real key="value" value="1"/>
139− </userDefinedRuntimeAttribute>
140− <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
141− <real key="value" value="2"/>
142− </userDefinedRuntimeAttribute>
143− <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
144− <real key="value" value="4"/>
145− </userDefinedRuntimeAttribute>
146− <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"/>
148− </userDefinedRuntimeAttribute>
149− <userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
150− <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
151− </userDefinedRuntimeAttribute>
152− <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
153− <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
154− </userDefinedRuntimeAttribute>
155− <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"/>
157− </userDefinedRuntimeAttribute>
158− <userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
159− <color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
160− </userDefinedRuntimeAttribute>
161− </userDefinedRuntimeAttributes>
162− </view>
163 </subviews>
126 </subviews>
164− <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
127+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
165 <constraints>
128 <constraints>
166 <constraint firstItem="R9n-I0-fq7" firstAttribute="centerX" secondItem="U8X-8Z-7Mo" secondAttribute="centerX" id="3cD-WW-Qg4"/>
129 <constraint firstItem="R9n-I0-fq7" firstAttribute="centerX" secondItem="U8X-8Z-7Mo" secondAttribute="centerX" id="3cD-WW-Qg4"/>
167 <constraint firstItem="if7-U5-bAM" firstAttribute="top" secondItem="AU6-4C-B2F" secondAttribute="bottom" constant="44" id="662-W9-CUn"/>
130 <constraint firstItem="if7-U5-bAM" firstAttribute="top" secondItem="AU6-4C-B2F" secondAttribute="bottom" constant="44" id="662-W9-CUn"/>
@@ -171,9 +134,7 @@
171 <constraint firstItem="if7-U5-bAM" firstAttribute="centerX" secondItem="R9n-I0-fq7" secondAttribute="centerX" id="K7g-rC-ehJ"/>
134 <constraint firstItem="if7-U5-bAM" firstAttribute="centerX" secondItem="R9n-I0-fq7" secondAttribute="centerX" id="K7g-rC-ehJ"/>
172 <constraint firstItem="U8X-8Z-7Mo" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" constant="8" id="S1b-pD-UXA"/>
135 <constraint firstItem="U8X-8Z-7Mo" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" constant="8" id="S1b-pD-UXA"/>
173 <constraint firstItem="U8X-8Z-7Mo" firstAttribute="top" secondItem="R9n-I0-fq7" secondAttribute="bottom" constant="44" id="fBW-Xx-pa0"/>
136 <constraint firstItem="U8X-8Z-7Mo" firstAttribute="top" secondItem="R9n-I0-fq7" secondAttribute="bottom" constant="44" id="fBW-Xx-pa0"/>
174− <constraint firstItem="9Ri-Yr-sRs" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="fay-qT-jKR"/>
175 <constraint firstItem="AU6-4C-B2F" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" constant="8" id="iIM-b2-jzV"/>
137 <constraint firstItem="AU6-4C-B2F" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" constant="8" id="iIM-b2-jzV"/>
176− <constraint firstItem="9Ri-Yr-sRs" firstAttribute="top" secondItem="U8X-8Z-7Mo" secondAttribute="bottom" constant="44" id="nKi-Fp-8B7"/>
177 <constraint firstAttribute="trailingMargin" secondItem="U8X-8Z-7Mo" secondAttribute="trailing" constant="8" id="ppd-nb-fL8"/>
138 <constraint firstAttribute="trailingMargin" secondItem="U8X-8Z-7Mo" secondAttribute="trailing" constant="8" id="ppd-nb-fL8"/>
178 <constraint firstItem="AU6-4C-B2F" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="8" symbolic="YES" id="zDK-gF-kms"/>
139 <constraint firstItem="AU6-4C-B2F" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="8" symbolic="YES" id="zDK-gF-kms"/>
179 </constraints>
140 </constraints>
@@ -184,7 +145,6 @@
184 </viewController>
145 </viewController>
185 <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
146 <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
186 </objects>
147 </objects>
187− <point key="canvasLocation" x="274" y="363"/>
188 </scene>
148 </scene>
189 </scenes>
149 </scenes>
190</document>
150</document>
GMStepperExample/GMStepperExample/Info.plist+1−1
@@ -7,7 +7,7 @@
7 <key>CFBundleExecutable</key>
7 <key>CFBundleExecutable</key>
8 <string>$(EXECUTABLE_NAME)</string>
8 <string>$(EXECUTABLE_NAME)</string>
9 <key>CFBundleIdentifier</key>
9 <key>CFBundleIdentifier</key>
10− <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
10+ <string>com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)</string>
11 <key>CFBundleInfoDictionaryVersion</key>
11 <key>CFBundleInfoDictionaryVersion</key>
12 <string>6.0</string>
12 <string>6.0</string>
13 <key>CFBundleName</key>
13 <key>CFBundleName</key>
GMStepperExample/GMStepperExample/ViewController.swift+3−3
@@ -13,10 +13,10 @@ class ViewController: UIViewController {
13 @IBOutlet weak var stepper: GMStepper!
13 @IBOutlet weak var stepper: GMStepper!
14 override func viewDidLoad() {
14 override func viewDidLoad() {
15 super.viewDidLoad()
15 super.viewDidLoad()
16− stepper.addTarget(self, action: #selector(ViewController.stepperValueChanged), for: .valueChanged)
16+ stepper.addTarget(self, action: "stepperValueChanged:", forControlEvents: .ValueChanged)
17 }
17 }
18
18
19− @objc func stepperValueChanged(stepper: GMStepper) {
19+ func stepperValueChanged(stepper: GMStepper) {
20− print(stepper.value, terminator: "")
20+ println(stepper.value)
21 }
21 }
22}
22}
GMStepperExample/GMStepperExampleTests/GMStepperExampleTests.swift+17−23
@@ -6,37 +6,31 @@
6// Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved.
6// Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved.
7//
7//
8
8
9−import XCTest
10import UIKit
9import UIKit
10+import XCTest
11
11
12class GMStepperExampleTests: XCTestCase {
12class GMStepperExampleTests: XCTestCase {
13− var stepper: GMStepper!
13+
14−
15 override func setUp() {
14 override func setUp() {
16 super.setUp()
15 super.setUp()
17− stepper = GMStepper()
16+ // Put setup code here. This method is called before the invocation of each test method in the class.
18 }
17 }
19−
18+
20− func testDefaults() {
19+ override func tearDown() {
21− XCTAssert(stepper.minimumValue == 0, "minimumValue defaults 0")
20+ // Put teardown code here. This method is called after the invocation of each test method in the class.
22− XCTAssert(stepper.maximumValue == 100, "maximumValue defaults to 100")
21+ super.tearDown()
23− XCTAssert(stepper.value == 0, "value defaults to 0")
24− }
25−
26− func testMinimum_limitsValue() {
27− stepper.minimumValue = 1
28− stepper.value = 0
29−
30− XCTAssert(stepper.value == stepper.minimumValue, "Pass")
31 }
22 }
32−
23+
33− func testMaximum_limitsValue() {
24+ func testExample() {
34− let stepper = GMStepper()
25+ // This is an example of a functional test case.
35− stepper.maximumValue = 1
36− stepper.value = 2
37−
38− XCTAssert(stepper.value == stepper.maximumValue, "Pass")
26+ XCTAssert(true, "Pass")
39 }
27 }
40
28
29+ func testPerformanceExample() {
30+ // This is an example of a performance test case.
31+ self.measureBlock() {
32+ // Put the code you want to measure the time of here.
33+ }
34+ }
41
35
42}
36}
GMStepperExample/GMStepperExampleTests/Info.plist+3−1
@@ -7,7 +7,7 @@
7 <key>CFBundleExecutable</key>
7 <key>CFBundleExecutable</key>
8 <string>$(EXECUTABLE_NAME)</string>
8 <string>$(EXECUTABLE_NAME)</string>
9 <key>CFBundleIdentifier</key>
9 <key>CFBundleIdentifier</key>
10− <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
10+ <string>com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)</string>
11 <key>CFBundleInfoDictionaryVersion</key>
11 <key>CFBundleInfoDictionaryVersion</key>
12 <string>6.0</string>
12 <string>6.0</string>
13 <key>CFBundleName</key>
13 <key>CFBundleName</key>
@@ -16,6 +16,8 @@
16 <string>BNDL</string>
16 <string>BNDL</string>
17 <key>CFBundleShortVersionString</key>
17 <key>CFBundleShortVersionString</key>
18 <string>1.0</string>
18 <string>1.0</string>
19+ <key>CFBundleSignature</key>
20+ <string>????</string>
19 <key>CFBundleVersion</key>
21 <key>CFBundleVersion</key>
20 <string>1</string>
22 <string>1</string>
21</dict>
23</dict>
README.md+2−95
@@ -3,99 +3,6 @@
3[![License](https://img.shields.io/cocoapods/l/GMStepper.svg?style=flat)](http://cocoapods.org/pods/GMStepper)
3[![License](https://img.shields.io/cocoapods/l/GMStepper.svg?style=flat)](http://cocoapods.org/pods/GMStepper)
4[![Platform](https://img.shields.io/cocoapods/p/GMStepper.svg?style=flat)](http://cocoapods.org/pods/GMStepper)
4[![Platform](https://img.shields.io/cocoapods/p/GMStepper.svg?style=flat)](http://cocoapods.org/pods/GMStepper)
5
5
6−A 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/).
6+A stepper with a sliding label in the middle.
7−
8−
9−## Screenshot
10−
11−![Screenshot_1.gif](https://raw.githubusercontent.com/gmertk/GMStepper/master/Screenshots/screenshot_1.gif)
12−
13−
14−## Usage
15−
16−GMStepper is available through [CocoaPods](http://cocoapods.org). To install
17−it, simply add the following lines to your Podfile:
18−
19−```ruby
20−use_frameworks!
21−pod "GMStepper"
22−```
23−
24−## Setup
25−
26−If you want to use storyboards, just drop a UIView into your storyboard and set its class to `GMStepper`. Then customize through the attributes inspector. Otherwise, you can write the code to initialize with frame and set the properties.
27−
28−## Properties
29−```swift
30−/// Current value of the stepper. Defaults to 0.
31−var value: Double = 0
32−
33−/// Minimum value. Must be less than maximumValue. Defaults to 0.
34−var minimumValue: Double = 0
35−
36−/// Maximum value. Must be more than minimumValue. Defaults to 100.
37−var maximumValue: Double = 100
38−
39−/// Step/Increment value as in UIStepper. Defaults to 1.
40−var stepValue: Double = 1
41−
42−/// The same as UIStepper's autorepeat. If true, holding on the buttons or keeping the pan gesture alters the value repeatedly. Defaults to true.
43−var autorepeat: Bool = true
44−
45−/// If the value is integer, it is shown without floating point.
46−var showIntegerIfDoubleIsInteger: Bool = true
47−
48−/// Text on the left button. Be sure that it fits in the button. Defaults to "-".
49−var leftButtonText: String = "-"
50−
51−/// Text on the right button. Be sure that it fits in the button. Defaults to "+".
52−var rightButtonText: String = "+"
53−
54−/// Text color of the buttons. Defaults to white
55−var buttonsTextColor: UIColor = UIColor.whiteColor()
56−
57−/// Background color of the buttons. Defaults to dark blue.
58−var buttonsBackgroundColor: UIColor = UIColor(red:0.21, green:0.5, blue:0.74, alpha:1)
59−
60−/// Font of the buttons. Defaults to AvenirNext-Bold, 20.0 points in size.
61−var buttonsFont = UIFont(name: "AvenirNext-Bold", size: 20.0)
62−
63−/// Text color of the middle label. Defaults to white.
64−var labelTextColor: UIColor = UIColor.whiteColor()
65−
66−/// Text color of the middle label. Defaults to lighter blue.
67−var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
68−
69−/// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
70−var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)
71−
72−/// Corner radius of the middle label's layer. Defaults to 0.0.
73−var labelCornerRadius: CGFloat = 0.0
74−
75−/// Corner radius of the stepper's layer. Defaults to 4.0.
76−var cornerRadius: CGFloat = 4.0
77−
78−/// Border width of the stepper and middle label's layer. Defaults to 0.0.
79−var borderWidth: CGFloat = 0.0
80−
81−/// Color of the border of the stepper and middle label's layer. Defaults to clear color.
82−var borderColor: UIColor = UIColor.clearColor()
83−
84−/// 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.
85−var labelWidthWeight: CGFloat = 0.5
86−
87−/// Color of the flashing animation on the buttons in case the value hit the limit.
88−var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
89−```
90−
91−
92−## Authors
93−
94−* [Brent Whitman](https://github.com/bwhtmn) - Maintainer
95−* [Günay Mert Karadoğan](https://github.com/gmertk) - Creator
96−
97−## License
98−
99−GMStepper is available under the MIT license. See the LICENSE file for more info.
100−
101
7
8+![Screenshot 0](https://raw.githubusercontent.com/gmertk/GMStepper/master/Screenshots/screenshot_0.png)
Screenshots/screenshot_0.pngnew file

Binary file not shown.

Screenshots/screenshot_1.gifdeleted

Binary file not shown.