Compare commits
28 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
d7c8bb83b0 | |
|
|
810fcbefea | |
|
|
f893371f73 | |
|
|
9444b32028 | |
|
|
dd09a1e0d9 | |
|
|
a02560f7e0 | |
|
|
3c81fa9ade | |
|
|
719830b81e | |
|
|
82453c0681 | |
|
|
7367554d53 | |
|
|
4bb23e79aa | |
|
|
e91c2577e4 | |
|
|
d81e614d1b | |
|
|
338fa1ebad | |
|
|
ae98a8c70b | |
|
|
c2748bb776 | |
|
|
4c5bfffbb8 | |
|
|
71c1c1b9a6 | |
|
|
b470b560b9 | |
|
|
a47725de8b | |
|
|
8af374c283 | |
|
|
88dd8d76b6 | |
|
|
07616aa0ff | |
|
|
44f1477df1 | |
|
|
fae1225e36 | |
|
|
ae068ac0fd | |
|
|
35f3db649a | |
|
|
96389e6d75 |
|
|
@ -0,0 +1 @@
|
||||||
|
4.2
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = "GMStepper"
|
s.name = "GMStepper"
|
||||||
s.version = "1.2.0"
|
s.version = "2.2.1"
|
||||||
s.summary = "A stepper with a sliding label in the middle."
|
s.summary = "A stepper with a sliding label in the middle."
|
||||||
s.homepage = "https://github.com/gmertk/GMStepper"
|
s.homepage = "https://github.com/gmertk/GMStepper"
|
||||||
s.screenshots = "https://dl.dropboxusercontent.com/u/4397140/pod-screenshots/screenshot_1.png"
|
s.screenshots = "https://raw.githubusercontent.com/gmertk/GMStepper/master/Screenshots/screenshot_1.gif"
|
||||||
s.license = 'MIT'
|
s.license = 'MIT'
|
||||||
s.author = { "Gunay Mert Karadogan" => "mertkaradogan@gmail.com" }
|
s.authors = { "Gunay Mert Karadogan" => "mertkaradogan@gmail.com",
|
||||||
|
"Brent Whitman" => "brent@pathym.com" }
|
||||||
s.source = { :git => "https://github.com/gmertk/GMStepper.git", :tag => s.version.to_s }
|
s.source = { :git => "https://github.com/gmertk/GMStepper.git", :tag => s.version.to_s }
|
||||||
s.social_media_url = 'https://twitter.com/gunaymertk'
|
s.social_media_url = 'https://twitter.com/gunaymertk'
|
||||||
s.platform = :ios, '8.0'
|
s.platform = :ios, '8.0'
|
||||||
s.requires_arc = true
|
s.requires_arc = true
|
||||||
s.source_files = 'GMStepper/*.swift'
|
s.source_files = 'GMStepper/*.swift'
|
||||||
|
s.swift_version = '4.2'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,24 +11,13 @@ import UIKit
|
||||||
@IBDesignable public class GMStepper: UIControl {
|
@IBDesignable public class GMStepper: UIControl {
|
||||||
|
|
||||||
/// Current value of the stepper. Defaults to 0.
|
/// Current value of the stepper. Defaults to 0.
|
||||||
@IBInspectable public var value: Double = 0 {
|
@objc @IBInspectable public var value: Double = 0 {
|
||||||
didSet {
|
didSet {
|
||||||
value = min(maximumValue, max(minimumValue, value))
|
value = min(maximumValue, max(minimumValue, value))
|
||||||
|
|
||||||
let isInteger = floor(value) == value
|
handleIsLimitReached()
|
||||||
|
|
||||||
//
|
label.text = formattedValue
|
||||||
// If we have items, we will display them as steps
|
|
||||||
//
|
|
||||||
|
|
||||||
if isInteger && stepValue == 1.0 && items.count > 0 {
|
|
||||||
label.text = items[Int(value)]
|
|
||||||
}
|
|
||||||
else if showIntegerIfDoubleIsInteger && isInteger {
|
|
||||||
label.text = String(stringInterpolationSegment: Int(value))
|
|
||||||
} else {
|
|
||||||
label.text = String(stringInterpolationSegment: value)
|
|
||||||
}
|
|
||||||
|
|
||||||
if oldValue != value {
|
if oldValue != value {
|
||||||
sendActions(for: .valueChanged)
|
sendActions(for: .valueChanged)
|
||||||
|
|
@ -36,54 +25,82 @@ import UIKit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var formattedValue: String? {
|
||||||
|
let isInteger = Decimal(value).exponent >= 0
|
||||||
|
|
||||||
|
// If we have items, we will display them as steps
|
||||||
|
if isInteger && stepValue == 1.0 && items.count > 0 {
|
||||||
|
return items[Int(value)]
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return formatter.string(from: NSNumber(value: value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Minimum value. Must be less than maximumValue. Defaults to 0.
|
/// Minimum value. Must be less than maximumValue. Defaults to 0.
|
||||||
@IBInspectable public var minimumValue: Double = 0 {
|
@objc @IBInspectable public var minimumValue: Double = 0 {
|
||||||
didSet {
|
didSet {
|
||||||
value = min(maximumValue, max(minimumValue, value))
|
value = min(maximumValue, max(minimumValue, value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Maximum value. Must be more than minimumValue. Defaults to 100.
|
/// Maximum value. Must be more than minimumValue. Defaults to 100.
|
||||||
@IBInspectable public var maximumValue: Double = 100 {
|
@objc @IBInspectable public var maximumValue: Double = 100 {
|
||||||
didSet {
|
didSet {
|
||||||
value = min(maximumValue, max(minimumValue, value))
|
value = min(maximumValue, max(minimumValue, value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Step/Increment value as in UIStepper. Defaults to 1.
|
/// Step/Increment value as in UIStepper. Defaults to 1.
|
||||||
@IBInspectable public var stepValue: Double = 1
|
@objc @IBInspectable public var stepValue: Double = 1 {
|
||||||
|
didSet {
|
||||||
|
setupNumberFormatter()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The same as UIStepper's autorepeat. If true, holding on the buttons or keeping the pan gesture alters the value repeatedly. Defaults to true.
|
/// The same as UIStepper's autorepeat. If true, holding on the buttons or keeping the pan gesture alters the value repeatedly. Defaults to true.
|
||||||
@IBInspectable public var autorepeat: Bool = true
|
@objc @IBInspectable public var autorepeat: Bool = true
|
||||||
|
|
||||||
/// If the value is integer, it is shown without floating point.
|
/// If the value is integer, it is shown without floating point.
|
||||||
@IBInspectable public var showIntegerIfDoubleIsInteger: Bool = true
|
@objc @IBInspectable public var showIntegerIfDoubleIsInteger: Bool = true {
|
||||||
|
|
||||||
/// Text on the left button. Be sure that it fits in the button. Defaults to "−".
|
|
||||||
@IBInspectable public var leftButtonText: String = "−" {
|
|
||||||
didSet {
|
didSet {
|
||||||
leftButton.setTitle(leftButtonText, for: .normal)
|
setupNumberFormatter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Text on the right button. Be sure that it fits in the button. Defaults to "+".
|
/// Image on the left button. Defaults to nil.
|
||||||
@IBInspectable public var rightButtonText: String = "+" {
|
@objc @IBInspectable public var leftButtonImage: UIImage? = nil {
|
||||||
didSet {
|
didSet {
|
||||||
rightButton.setTitle(rightButtonText, for: .normal)
|
leftButton.setImage(leftButtonImage, for: .normal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Text color of the buttons. Defaults to white.
|
/// Image on the right button. Defaults to nil.
|
||||||
@IBInspectable public var buttonsTextColor: UIColor = UIColor.white {
|
@objc @IBInspectable public var rightButtonImage: UIImage? = nil {
|
||||||
didSet {
|
didSet {
|
||||||
for button in [leftButton, rightButton] {
|
rightButton.setImage(rightButtonImage, for: .normal)
|
||||||
button.setTitleColor(buttonsTextColor, for: .normal)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Left button content insets. Defaults to ".zero".
|
||||||
|
@objc @IBInspectable public var leftButtonContentInsets: UIEdgeInsets = .zero {
|
||||||
|
didSet {
|
||||||
|
leftButton.contentEdgeInsets = leftButtonContentInsets
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Right button content insets. Defaults to ".zero".
|
||||||
|
@objc @IBInspectable public var rightButtonContentInsets: UIEdgeInsets = .zero {
|
||||||
|
didSet {
|
||||||
|
rightButton.contentEdgeInsets = rightButtonContentInsets
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Left button limit opacity. Defaults to "0.4".
|
||||||
|
@objc @IBInspectable public var leftButtonLimitOpacity: CGFloat = 0.4
|
||||||
|
|
||||||
/// Background color of the buttons. Defaults to dark blue.
|
/// Background color of the buttons. Defaults to dark blue.
|
||||||
@IBInspectable public var buttonsBackgroundColor: UIColor = UIColor(red:0.21, green:0.5, blue:0.74, alpha:1) {
|
@objc @IBInspectable public var buttonsBackgroundColor: UIColor = UIColor(red:0.21, green:0.5, blue:0.74, alpha:1) {
|
||||||
didSet {
|
didSet {
|
||||||
for button in [leftButton, rightButton] {
|
for button in [leftButton, rightButton] {
|
||||||
button.backgroundColor = buttonsBackgroundColor
|
button.backgroundColor = buttonsBackgroundColor
|
||||||
|
|
@ -92,38 +109,42 @@ import UIKit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Font of the buttons. Defaults to AvenirNext-Bold, 20.0 points in size.
|
/// Label tap closure
|
||||||
public var buttonsFont = UIFont(name: "AvenirNext-Bold", size: 20.0)! {
|
@objc public var didTouchLabel: ((Double) -> Void)?
|
||||||
didSet {
|
|
||||||
for button in [leftButton, rightButton] {
|
/// Block is called when the minimum is exceeded
|
||||||
button.titleLabel?.font = buttonsFont
|
@objc public var minimumExceeded: (() -> Void)?
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Text color of the middle label. Defaults to white.
|
/// Text color of the middle label. Defaults to white.
|
||||||
@IBInspectable public var labelTextColor: UIColor = UIColor.white {
|
@objc @IBInspectable public var labelTextColor: UIColor = UIColor.white {
|
||||||
didSet {
|
didSet {
|
||||||
label.textColor = labelTextColor
|
label.textColor = labelTextColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Text color of the middle label. Defaults to lighter blue.
|
/// Text color of the middle label. Defaults to lighter blue.
|
||||||
@IBInspectable public var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1) {
|
@objc @IBInspectable public var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1) {
|
||||||
didSet {
|
didSet {
|
||||||
label.backgroundColor = labelBackgroundColor
|
label.backgroundColor = labelBackgroundColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
|
/// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
|
||||||
public var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)! {
|
@objc public var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)! {
|
||||||
didSet {
|
didSet {
|
||||||
label.font = labelFont
|
label.font = labelFont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// Corner radius of the middle label. Defaults to 0.
|
||||||
|
@objc @IBInspectable public var labelCornerRadius: CGFloat = 0 {
|
||||||
|
didSet {
|
||||||
|
label.layer.cornerRadius = labelCornerRadius
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Corner radius of the stepper's layer. Defaults to 4.0.
|
/// Corner radius of the stepper's layer. Defaults to 4.0.
|
||||||
@IBInspectable public var cornerRadius: CGFloat = 4.0 {
|
@objc @IBInspectable public var cornerRadius: CGFloat = 4.0 {
|
||||||
didSet {
|
didSet {
|
||||||
layer.cornerRadius = cornerRadius
|
layer.cornerRadius = cornerRadius
|
||||||
clipsToBounds = true
|
clipsToBounds = true
|
||||||
|
|
@ -131,7 +152,7 @@ import UIKit
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Border width of the stepper and middle label's layer. Defaults to 0.0.
|
/// Border width of the stepper and middle label's layer. Defaults to 0.0.
|
||||||
@IBInspectable public var borderWidth: CGFloat = 0.0 {
|
@objc @IBInspectable public var borderWidth: CGFloat = 0.0 {
|
||||||
didSet {
|
didSet {
|
||||||
layer.borderWidth = borderWidth
|
layer.borderWidth = borderWidth
|
||||||
label.layer.borderWidth = borderWidth
|
label.layer.borderWidth = borderWidth
|
||||||
|
|
@ -139,7 +160,7 @@ import UIKit
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Color of the border of the stepper and middle label's layer. Defaults to clear color.
|
/// Color of the border of the stepper and middle label's layer. Defaults to clear color.
|
||||||
@IBInspectable public var borderColor: UIColor = UIColor.clear {
|
@objc @IBInspectable public var borderColor: UIColor = UIColor.clear {
|
||||||
didSet {
|
didSet {
|
||||||
layer.borderColor = borderColor.cgColor
|
layer.borderColor = borderColor.cgColor
|
||||||
label.layer.borderColor = borderColor.cgColor
|
label.layer.borderColor = borderColor.cgColor
|
||||||
|
|
@ -147,7 +168,7 @@ import UIKit
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 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.
|
/// 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.
|
||||||
@IBInspectable public var labelWidthWeight: CGFloat = 0.5 {
|
@objc @IBInspectable public var labelWidthWeight: CGFloat = 0.5 {
|
||||||
didSet {
|
didSet {
|
||||||
labelWidthWeight = min(1, max(0, labelWidthWeight))
|
labelWidthWeight = min(1, max(0, labelWidthWeight))
|
||||||
setNeedsLayout()
|
setNeedsLayout()
|
||||||
|
|
@ -155,7 +176,10 @@ import UIKit
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Color of the flashing animation on the buttons in case the value hit the limit.
|
/// Color of the flashing animation on the buttons in case the value hit the limit.
|
||||||
@IBInspectable public var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
|
@objc @IBInspectable public var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)
|
||||||
|
|
||||||
|
/// Formatter for displaying the current value
|
||||||
|
let formatter = NumberFormatter()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Width of the sliding animation. When buttons clicked, the middle label does a slide animation towards to the clicked button. Defaults to 5.
|
Width of the sliding animation. When buttons clicked, the middle label does a slide animation towards to the clicked button. Defaults to 5.
|
||||||
|
|
@ -170,43 +194,41 @@ import UIKit
|
||||||
|
|
||||||
lazy var leftButton: UIButton = {
|
lazy var leftButton: UIButton = {
|
||||||
let button = UIButton()
|
let button = UIButton()
|
||||||
button.setTitle(self.leftButtonText, for: .normal)
|
button.setImage(self.leftButtonImage, for: .normal)
|
||||||
button.setTitleColor(self.buttonsTextColor, for: .normal)
|
|
||||||
button.backgroundColor = self.buttonsBackgroundColor
|
button.backgroundColor = self.buttonsBackgroundColor
|
||||||
button.titleLabel?.font = self.buttonsFont
|
|
||||||
button.addTarget(self, action: #selector(GMStepper.leftButtonTouchDown), for: .touchDown)
|
button.addTarget(self, action: #selector(GMStepper.leftButtonTouchDown), for: .touchDown)
|
||||||
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
|
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
|
||||||
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
|
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
|
||||||
|
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
lazy var rightButton: UIButton = {
|
lazy var rightButton: UIButton = {
|
||||||
let button = UIButton()
|
let button = UIButton()
|
||||||
button.setTitle(self.rightButtonText, for: .normal)
|
button.setImage(self.rightButtonImage, for: .normal)
|
||||||
button.setTitleColor(self.buttonsTextColor, for: .normal)
|
|
||||||
button.backgroundColor = self.buttonsBackgroundColor
|
button.backgroundColor = self.buttonsBackgroundColor
|
||||||
button.titleLabel?.font = self.buttonsFont
|
|
||||||
button.addTarget(self, action: #selector(GMStepper.rightButtonTouchDown), for: .touchDown)
|
button.addTarget(self, action: #selector(GMStepper.rightButtonTouchDown), for: .touchDown)
|
||||||
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
|
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpInside)
|
||||||
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
|
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchUpOutside)
|
||||||
|
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
lazy var label: UILabel = {
|
lazy var label: UILabel = {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.textAlignment = .center
|
label.textAlignment = .center
|
||||||
if self.showIntegerIfDoubleIsInteger && floor(self.value) == self.value {
|
label.text = formattedValue
|
||||||
label.text = String(stringInterpolationSegment: Int(self.value))
|
|
||||||
} else {
|
|
||||||
label.text = String(stringInterpolationSegment: self.value)
|
|
||||||
}
|
|
||||||
label.textColor = self.labelTextColor
|
label.textColor = self.labelTextColor
|
||||||
label.backgroundColor = self.labelBackgroundColor
|
label.backgroundColor = self.labelBackgroundColor
|
||||||
label.font = self.labelFont
|
label.font = self.labelFont
|
||||||
|
label.layer.cornerRadius = self.labelCornerRadius
|
||||||
|
label.layer.masksToBounds = true
|
||||||
label.isUserInteractionEnabled = true
|
label.isUserInteractionEnabled = true
|
||||||
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(GMStepper.handlePan))
|
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(GMStepper.handlePan))
|
||||||
panRecognizer.maximumNumberOfTouches = 1
|
panRecognizer.maximumNumberOfTouches = 1
|
||||||
label.addGestureRecognizer(panRecognizer)
|
label.addGestureRecognizer(panRecognizer)
|
||||||
|
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(GMStepper.handleLabelTap))
|
||||||
|
label.addGestureRecognizer(tapRecognizer)
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
@ -234,26 +256,9 @@ import UIKit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public var items : [String] = [] {
|
@objc public var items : [String] = [] {
|
||||||
didSet {
|
didSet {
|
||||||
let isInteger = floor(value) == value
|
label.text = formattedValue
|
||||||
|
|
||||||
//
|
|
||||||
// If we have items, we will display them as steps
|
|
||||||
//
|
|
||||||
|
|
||||||
if isInteger && stepValue == 1.0 && items.count > 0 {
|
|
||||||
|
|
||||||
var value = Int(self.value)
|
|
||||||
|
|
||||||
if value >= items.count {
|
|
||||||
value = items.count - 1
|
|
||||||
self.value = Double(value)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
label.text = items[value]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -280,26 +285,38 @@ import UIKit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
required public init?(coder aDecoder: NSCoder) {
|
@objc required public init?(coder aDecoder: NSCoder) {
|
||||||
super.init(coder: aDecoder)
|
super.init(coder: aDecoder)
|
||||||
setup()
|
setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override init(frame: CGRect) {
|
@objc public override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
setup()
|
setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
func setup() {
|
fileprivate func setup() {
|
||||||
addSubview(leftButton)
|
addSubview(leftButton)
|
||||||
addSubview(rightButton)
|
addSubview(rightButton)
|
||||||
addSubview(label)
|
addSubview(label)
|
||||||
|
|
||||||
|
handleIsLimitReached()
|
||||||
backgroundColor = buttonsBackgroundColor
|
backgroundColor = buttonsBackgroundColor
|
||||||
layer.cornerRadius = cornerRadius
|
layer.cornerRadius = cornerRadius
|
||||||
clipsToBounds = true
|
clipsToBounds = true
|
||||||
|
labelOriginalCenter = label.center
|
||||||
|
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(GMStepper.reset), name: NSNotification.Name.UIApplicationWillResignActive, object: nil)
|
setupNumberFormatter()
|
||||||
|
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(GMStepper.reset), name: UIApplication.willResignActiveNotification, object: nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupNumberFormatter() {
|
||||||
|
let decValue = Decimal(stepValue)
|
||||||
|
let digits = decValue.significantFractionalDecimalDigits
|
||||||
|
formatter.minimumIntegerDigits = 1
|
||||||
|
formatter.minimumFractionDigits = showIntegerIfDoubleIsInteger ? 0 : digits
|
||||||
|
formatter.maximumFractionDigits = digits
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func layoutSubviews() {
|
public override func layoutSubviews() {
|
||||||
|
|
@ -323,6 +340,7 @@ import UIKit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
resetTimer()
|
resetTimer()
|
||||||
NotificationCenter.default.removeObserver(self)
|
NotificationCenter.default.removeObserver(self)
|
||||||
|
|
@ -344,7 +362,7 @@ import UIKit
|
||||||
|
|
||||||
// MARK: Pan Gesture
|
// MARK: Pan Gesture
|
||||||
extension GMStepper {
|
extension GMStepper {
|
||||||
func handlePan(gesture: UIPanGestureRecognizer) {
|
@objc func handlePan(gesture: UIPanGestureRecognizer) {
|
||||||
switch gesture.state {
|
switch gesture.state {
|
||||||
case .began:
|
case .began:
|
||||||
leftButton.isEnabled = false
|
leftButton.isEnabled = false
|
||||||
|
|
@ -394,7 +412,11 @@ extension GMStepper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func reset() {
|
@objc func handleLabelTap() {
|
||||||
|
didTouchLabel?(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func reset() {
|
||||||
panState = .Stable
|
panState = .Stable
|
||||||
stepperState = .Stable
|
stepperState = .Stable
|
||||||
resetTimer()
|
resetTimer()
|
||||||
|
|
@ -413,21 +435,21 @@ extension GMStepper {
|
||||||
|
|
||||||
// MARK: Button Events
|
// MARK: Button Events
|
||||||
extension GMStepper {
|
extension GMStepper {
|
||||||
func leftButtonTouchDown(button: UIButton) {
|
@objc func leftButtonTouchDown(button: UIButton) {
|
||||||
rightButton.isEnabled = false
|
rightButton.isEnabled = false
|
||||||
label.isUserInteractionEnabled = false
|
label.isUserInteractionEnabled = false
|
||||||
resetTimer()
|
resetTimer()
|
||||||
|
|
||||||
if value == minimumValue {
|
if value == minimumValue {
|
||||||
animateLimitHitIfNeeded()
|
animateLimitHitIfNeeded()
|
||||||
|
minimumExceeded?()
|
||||||
} else {
|
} else {
|
||||||
stepperState = .ShouldDecrease
|
stepperState = .ShouldDecrease
|
||||||
animateSlideLeft()
|
animateSlideLeft()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func rightButtonTouchDown(button: UIButton) {
|
@objc func rightButtonTouchDown(button: UIButton) {
|
||||||
leftButton.isEnabled = false
|
leftButton.isEnabled = false
|
||||||
label.isUserInteractionEnabled = false
|
label.isUserInteractionEnabled = false
|
||||||
resetTimer()
|
resetTimer()
|
||||||
|
|
@ -440,7 +462,7 @@ extension GMStepper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func buttonTouchUp(button: UIButton) {
|
@objc func buttonTouchUp(button: UIButton) {
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -485,7 +507,7 @@ extension GMStepper {
|
||||||
|
|
||||||
// MARK: Timer
|
// MARK: Timer
|
||||||
extension GMStepper {
|
extension GMStepper {
|
||||||
func handleTimerFire(timer: Timer) {
|
@objc func handleTimerFire(timer: Timer) {
|
||||||
timerFireCount += 1
|
timerFireCount += 1
|
||||||
|
|
||||||
if timerFireCount % timerFireCountModulo == 0 {
|
if timerFireCount % timerFireCountModulo == 0 {
|
||||||
|
|
@ -504,6 +526,19 @@ extension GMStepper {
|
||||||
timerFireCount = 0
|
timerFireCount = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private extension GMStepper {
|
||||||
|
|
||||||
|
func handleIsLimitReached() {
|
||||||
|
let isLimitReached = value == minimumValue
|
||||||
|
leftButton.alpha = isLimitReached ? leftButtonLimitOpacity : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension Decimal {
|
||||||
|
|
||||||
|
var significantFractionalDecimalDigits: Int {
|
||||||
|
return max(-exponent, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,18 +7,18 @@
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
3169DD3E1B496C33009791D1 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
|
3116C0DB1DA4DD360015AC69 /* GMStepperExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3116C0DA1DA4DD360015AC69 /* GMStepperExampleTests.swift */; };
|
||||||
|
3198AC771DA4DEE500311FB3 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
|
||||||
319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19371B4843EB005EFEE5 /* AppDelegate.swift */; };
|
319C19381B4843EB005EFEE5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19371B4843EB005EFEE5 /* AppDelegate.swift */; };
|
||||||
319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19391B4843EB005EFEE5 /* ViewController.swift */; };
|
319C193A1B4843EB005EFEE5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C19391B4843EB005EFEE5 /* ViewController.swift */; };
|
||||||
319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 319C193B1B4843EB005EFEE5 /* Main.storyboard */; };
|
319C193D1B4843EB005EFEE5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 319C193B1B4843EB005EFEE5 /* Main.storyboard */; };
|
||||||
319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 319C193E1B4843EB005EFEE5 /* Images.xcassets */; };
|
319C193F1B4843EB005EFEE5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 319C193E1B4843EB005EFEE5 /* Images.xcassets */; };
|
||||||
319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319C19401B4843EB005EFEE5 /* LaunchScreen.xib */; };
|
319C19421B4843EB005EFEE5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319C19401B4843EB005EFEE5 /* LaunchScreen.xib */; };
|
||||||
319C194E1B4843EB005EFEE5 /* GMStepperExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */; };
|
|
||||||
319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
|
319C195C1B48445E005EFEE5 /* GMStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 319C195B1B48445E005EFEE5 /* GMStepper.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
319C19481B4843EB005EFEE5 /* PBXContainerItemProxy */ = {
|
3116C0DD1DA4DD360015AC69 /* PBXContainerItemProxy */ = {
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = 319C192A1B4843EB005EFEE5 /* Project object */;
|
containerPortal = 319C192A1B4843EB005EFEE5 /* Project object */;
|
||||||
proxyType = 1;
|
proxyType = 1;
|
||||||
|
|
@ -28,6 +28,9 @@
|
||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
3116C0D81DA4DD360015AC69 /* GMStepperExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GMStepperExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
3116C0DA1DA4DD360015AC69 /* GMStepperExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMStepperExampleTests.swift; sourceTree = "<group>"; };
|
||||||
|
3116C0DC1DA4DD360015AC69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
319C19321B4843EB005EFEE5 /* GMStepperExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GMStepperExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
319C19321B4843EB005EFEE5 /* GMStepperExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GMStepperExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
319C19361B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
319C19361B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
319C19371B4843EB005EFEE5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
319C19371B4843EB005EFEE5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
|
@ -35,21 +38,18 @@
|
||||||
319C193C1B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
319C193C1B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
319C193E1B4843EB005EFEE5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
319C193E1B4843EB005EFEE5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||||
319C19411B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
319C19411B4843EB005EFEE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||||
319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GMStepperExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
319C194C1B4843EB005EFEE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
||||||
319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMStepperExampleTests.swift; sourceTree = "<group>"; };
|
|
||||||
319C195B1B48445E005EFEE5 /* GMStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GMStepper.swift; sourceTree = "<group>"; };
|
319C195B1B48445E005EFEE5 /* GMStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GMStepper.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
319C192F1B4843EB005EFEE5 /* Frameworks */ = {
|
3116C0D51DA4DD360015AC69 /* Frameworks */ = {
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
319C19441B4843EB005EFEE5 /* Frameworks */ = {
|
319C192F1B4843EB005EFEE5 /* Frameworks */ = {
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
|
@ -59,12 +59,21 @@
|
||||||
/* End PBXFrameworksBuildPhase section */
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
/* Begin PBXGroup section */
|
||||||
|
3116C0D91DA4DD360015AC69 /* GMStepperExampleTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
3116C0DA1DA4DD360015AC69 /* GMStepperExampleTests.swift */,
|
||||||
|
3116C0DC1DA4DD360015AC69 /* Info.plist */,
|
||||||
|
);
|
||||||
|
path = GMStepperExampleTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
319C19291B4843EB005EFEE5 = {
|
319C19291B4843EB005EFEE5 = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
319C195A1B48445E005EFEE5 /* GMStepper */,
|
319C195A1B48445E005EFEE5 /* GMStepper */,
|
||||||
319C19341B4843EB005EFEE5 /* GMStepperExample */,
|
319C19341B4843EB005EFEE5 /* GMStepperExample */,
|
||||||
319C194A1B4843EB005EFEE5 /* GMStepperExampleTests */,
|
3116C0D91DA4DD360015AC69 /* GMStepperExampleTests */,
|
||||||
319C19331B4843EB005EFEE5 /* Products */,
|
319C19331B4843EB005EFEE5 /* Products */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
|
@ -73,7 +82,7 @@
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
319C19321B4843EB005EFEE5 /* GMStepperExample.app */,
|
319C19321B4843EB005EFEE5 /* GMStepperExample.app */,
|
||||||
319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */,
|
3116C0D81DA4DD360015AC69 /* GMStepperExampleTests.xctest */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
|
@ -99,23 +108,6 @@
|
||||||
name = "Supporting Files";
|
name = "Supporting Files";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
319C194A1B4843EB005EFEE5 /* GMStepperExampleTests */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
319C194D1B4843EB005EFEE5 /* GMStepperExampleTests.swift */,
|
|
||||||
319C194B1B4843EB005EFEE5 /* Supporting Files */,
|
|
||||||
);
|
|
||||||
path = GMStepperExampleTests;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
319C194B1B4843EB005EFEE5 /* Supporting Files */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
319C194C1B4843EB005EFEE5 /* Info.plist */,
|
|
||||||
);
|
|
||||||
name = "Supporting Files";
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
319C195A1B48445E005EFEE5 /* GMStepper */ = {
|
319C195A1B48445E005EFEE5 /* GMStepper */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
|
@ -128,6 +120,24 @@
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
|
3116C0D71DA4DD360015AC69 /* GMStepperExampleTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 3116C0DF1DA4DD360015AC69 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
3116C0D41DA4DD360015AC69 /* Sources */,
|
||||||
|
3116C0D51DA4DD360015AC69 /* Frameworks */,
|
||||||
|
3116C0D61DA4DD360015AC69 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
3116C0DE1DA4DD360015AC69 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = GMStepperExampleTests;
|
||||||
|
productName = GMStepperExampleTests;
|
||||||
|
productReference = 3116C0D81DA4DD360015AC69 /* GMStepperExampleTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
319C19311B4843EB005EFEE5 /* GMStepperExample */ = {
|
319C19311B4843EB005EFEE5 /* GMStepperExample */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 319C19511B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExample" */;
|
buildConfigurationList = 319C19511B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExample" */;
|
||||||
|
|
@ -145,24 +155,6 @@
|
||||||
productReference = 319C19321B4843EB005EFEE5 /* GMStepperExample.app */;
|
productReference = 319C19321B4843EB005EFEE5 /* GMStepperExample.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
319C19461B4843EB005EFEE5 /* GMStepperExampleTests */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 319C19541B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */;
|
|
||||||
buildPhases = (
|
|
||||||
319C19431B4843EB005EFEE5 /* Sources */,
|
|
||||||
319C19441B4843EB005EFEE5 /* Frameworks */,
|
|
||||||
319C19451B4843EB005EFEE5 /* Resources */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
319C19491B4843EB005EFEE5 /* PBXTargetDependency */,
|
|
||||||
);
|
|
||||||
name = GMStepperExampleTests;
|
|
||||||
productName = GMStepperExampleTests;
|
|
||||||
productReference = 319C19471B4843EB005EFEE5 /* GMStepperExampleTests.xctest */;
|
|
||||||
productType = "com.apple.product-type.bundle.unit-test";
|
|
||||||
};
|
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
/* Begin PBXProject section */
|
||||||
|
|
@ -170,20 +162,20 @@
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastSwiftMigration = 0700;
|
LastSwiftMigration = 0700;
|
||||||
LastSwiftUpdateCheck = 0700;
|
LastSwiftUpdateCheck = 0800;
|
||||||
LastUpgradeCheck = 0800;
|
LastUpgradeCheck = 0900;
|
||||||
ORGANIZATIONNAME = "Gunay Mert Karadogan";
|
ORGANIZATIONNAME = "Gunay Mert Karadogan";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
|
3116C0D71DA4DD360015AC69 = {
|
||||||
|
CreatedOnToolsVersion = 8.0;
|
||||||
|
LastSwiftMigration = 1000;
|
||||||
|
ProvisioningStyle = Automatic;
|
||||||
|
TestTargetID = 319C19311B4843EB005EFEE5;
|
||||||
|
};
|
||||||
319C19311B4843EB005EFEE5 = {
|
319C19311B4843EB005EFEE5 = {
|
||||||
CreatedOnToolsVersion = 6.4;
|
CreatedOnToolsVersion = 6.4;
|
||||||
DevelopmentTeam = 289M6XEDV4;
|
DevelopmentTeam = 289M6XEDV4;
|
||||||
LastSwiftMigration = 0800;
|
LastSwiftMigration = 1000;
|
||||||
};
|
|
||||||
319C19461B4843EB005EFEE5 = {
|
|
||||||
CreatedOnToolsVersion = 6.4;
|
|
||||||
DevelopmentTeam = 289M6XEDV4;
|
|
||||||
LastSwiftMigration = 0800;
|
|
||||||
TestTargetID = 319C19311B4843EB005EFEE5;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -201,12 +193,19 @@
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
319C19311B4843EB005EFEE5 /* GMStepperExample */,
|
319C19311B4843EB005EFEE5 /* GMStepperExample */,
|
||||||
319C19461B4843EB005EFEE5 /* GMStepperExampleTests */,
|
3116C0D71DA4DD360015AC69 /* GMStepperExampleTests */,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
|
|
||||||
/* Begin PBXResourcesBuildPhase section */
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
3116C0D61DA4DD360015AC69 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
319C19301B4843EB005EFEE5 /* Resources */ = {
|
319C19301B4843EB005EFEE5 /* Resources */ = {
|
||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
|
@ -217,16 +216,18 @@
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
319C19451B4843EB005EFEE5 /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
3116C0D41DA4DD360015AC69 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
3116C0DB1DA4DD360015AC69 /* GMStepperExampleTests.swift in Sources */,
|
||||||
|
3198AC771DA4DEE500311FB3 /* GMStepper.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
319C192E1B4843EB005EFEE5 /* Sources */ = {
|
319C192E1B4843EB005EFEE5 /* Sources */ = {
|
||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
|
@ -237,22 +238,13 @@
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
319C19431B4843EB005EFEE5 /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
319C194E1B4843EB005EFEE5 /* GMStepperExampleTests.swift in Sources */,
|
|
||||||
3169DD3E1B496C33009791D1 /* GMStepper.swift in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXSourcesBuildPhase section */
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXTargetDependency section */
|
/* Begin PBXTargetDependency section */
|
||||||
319C19491B4843EB005EFEE5 /* PBXTargetDependency */ = {
|
3116C0DE1DA4DD360015AC69 /* PBXTargetDependency */ = {
|
||||||
isa = PBXTargetDependency;
|
isa = PBXTargetDependency;
|
||||||
target = 319C19311B4843EB005EFEE5 /* GMStepperExample */;
|
target = 319C19311B4843EB005EFEE5 /* GMStepperExample */;
|
||||||
targetProxy = 319C19481B4843EB005EFEE5 /* PBXContainerItemProxy */;
|
targetProxy = 3116C0DD1DA4DD360015AC69 /* PBXContainerItemProxy */;
|
||||||
};
|
};
|
||||||
/* End PBXTargetDependency section */
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
|
|
@ -276,6 +268,42 @@
|
||||||
/* End PBXVariantGroup section */
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
/* Begin XCBuildConfiguration section */
|
/* Begin XCBuildConfiguration section */
|
||||||
|
3116C0E01DA4DD360015AC69 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.gmertk.GMStepperExampleTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
3116C0E11DA4DD360015AC69 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||||
|
INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.gmertk.GMStepperExampleTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 4.2;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
319C194F1B4843EB005EFEE5 /* Debug */ = {
|
319C194F1B4843EB005EFEE5 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
|
@ -284,14 +312,20 @@
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
|
@ -331,14 +365,20 @@
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
|
@ -369,10 +409,11 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
DEVELOPMENT_TEAM = 289M6XEDV4;
|
DEVELOPMENT_TEAM = 289M6XEDV4;
|
||||||
INFOPLIST_FILE = GMStepperExample/Info.plist;
|
INFOPLIST_FILE = GMStepperExample/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 4.2;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
|
@ -382,56 +423,26 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
DEVELOPMENT_TEAM = 289M6XEDV4;
|
DEVELOPMENT_TEAM = 289M6XEDV4;
|
||||||
INFOPLIST_FILE = GMStepperExample/Info.plist;
|
INFOPLIST_FILE = GMStepperExample/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 4.2;
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
319C19551B4843EB005EFEE5 /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
|
||||||
DEVELOPMENT_TEAM = 289M6XEDV4;
|
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
|
||||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
||||||
"DEBUG=1",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SWIFT_VERSION = 3.0;
|
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
319C19561B4843EB005EFEE5 /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
|
||||||
DEVELOPMENT_TEAM = 289M6XEDV4;
|
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
|
||||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
INFOPLIST_FILE = GMStepperExampleTests/Info.plist;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.gunaymert.$(PRODUCT_NAME:rfc1034identifier)";
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SWIFT_VERSION = 3.0;
|
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMStepperExample.app/GMStepperExample";
|
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
/* End XCBuildConfiguration section */
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
/* Begin XCConfigurationList section */
|
||||||
|
3116C0DF1DA4DD360015AC69 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
3116C0E01DA4DD360015AC69 /* Debug */,
|
||||||
|
3116C0E11DA4DD360015AC69 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
319C192D1B4843EB005EFEE5 /* Build configuration list for PBXProject "GMStepperExample" */ = {
|
319C192D1B4843EB005EFEE5 /* Build configuration list for PBXProject "GMStepperExample" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
|
|
@ -450,15 +461,6 @@
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
319C19541B4843EB005EFEE5 /* Build configuration list for PBXNativeTarget "GMStepperExampleTests" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
319C19551B4843EB005EFEE5 /* Debug */,
|
|
||||||
319C19561B4843EB005EFEE5 /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
};
|
};
|
||||||
rootObject = 319C192A1B4843EB005EFEE5 /* Project object */;
|
rootObject = 319C192A1B4843EB005EFEE5 /* Project object */;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
var window: UIWindow?
|
var window: UIWindow?
|
||||||
|
|
||||||
|
|
||||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationWillResignActive(application: UIApplication) {
|
func applicationWillResignActive(_ application: UIApplication) {
|
||||||
// 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.
|
// 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.
|
||||||
// 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.
|
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationDidEnterBackground(application: UIApplication) {
|
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||||
// 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.
|
// 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.
|
||||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationWillEnterForeground(application: UIApplication) {
|
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||||
// 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.
|
// 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.
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationDidBecomeActive(application: UIApplication) {
|
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||||
// 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.
|
// 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.
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationWillTerminate(application: UIApplication) {
|
func applicationWillTerminate(_ application: UIApplication) {
|
||||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<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">
|
<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">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
|
||||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<scenes>
|
<scenes>
|
||||||
<!--View Controller-->
|
<!--View Controller-->
|
||||||
|
|
@ -15,12 +16,11 @@
|
||||||
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
|
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AU6-4C-B2F" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AU6-4C-B2F" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
||||||
<rect key="frame" x="28" y="28" width="544" height="44"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="44" id="6mC-hP-wFD"/>
|
<constraint firstAttribute="height" constant="44" id="6mC-hP-wFD"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
|
|
@ -34,77 +34,74 @@
|
||||||
</userDefinedRuntimeAttributes>
|
</userDefinedRuntimeAttributes>
|
||||||
</view>
|
</view>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="if7-U5-bAM" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="if7-U5-bAM" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
||||||
<rect key="frame" x="140" y="116" width="320" height="66"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="66" id="iQi-6P-vt9"/>
|
<constraint firstAttribute="height" constant="66" id="iQi-6P-vt9"/>
|
||||||
<constraint firstAttribute="width" constant="320" id="ji4-Pf-1fZ"/>
|
<constraint firstAttribute="width" constant="320" id="ji4-Pf-1fZ"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<userDefinedRuntimeAttributes>
|
<userDefinedRuntimeAttributes>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
||||||
<color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
||||||
<color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="1" green="0.3591497541" blue="0.36842127060000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
||||||
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
||||||
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
|
||||||
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="number" keyPath="stepValue">
|
<userDefinedRuntimeAttribute type="number" keyPath="stepValue">
|
||||||
<real key="value" value="0.5"/>
|
<real key="value" value="0.1"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
</userDefinedRuntimeAttributes>
|
</userDefinedRuntimeAttributes>
|
||||||
</view>
|
</view>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R9n-I0-fq7" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R9n-I0-fq7" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
||||||
<rect key="frame" x="200" y="226" width="200" height="66"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="width" constant="200" id="dVu-w0-mf0"/>
|
<constraint firstAttribute="width" constant="200" id="dVu-w0-mf0"/>
|
||||||
<constraint firstAttribute="height" constant="66" id="ie8-vl-NAV"/>
|
<constraint firstAttribute="height" constant="66" id="ie8-vl-NAV"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<userDefinedRuntimeAttributes>
|
<userDefinedRuntimeAttributes>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
||||||
<color key="value" red="0.1819814891" green="0.69426733259999995" blue="0.53024792669999998" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.1819814891" green="0.69426733259999995" blue="0.53024792669999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
||||||
<color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
||||||
<color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
||||||
<color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
|
||||||
<color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.6588235294" green="0.85882352939999995" blue="0.6588235294" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
</userDefinedRuntimeAttributes>
|
</userDefinedRuntimeAttributes>
|
||||||
</view>
|
</view>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U8X-8Z-7Mo" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U8X-8Z-7Mo" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
||||||
<rect key="frame" x="28" y="336" width="544" height="44"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="44" id="aF3-T7-dIP"/>
|
<constraint firstAttribute="height" constant="44" id="aF3-T7-dIP"/>
|
||||||
<constraint firstAttribute="width" constant="200" id="vhP-7K-vOu"/>
|
<constraint firstAttribute="width" constant="200" id="vhP-7K-vOu"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<userDefinedRuntimeAttributes>
|
<userDefinedRuntimeAttributes>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
||||||
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
||||||
<color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
||||||
<color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
||||||
<color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="number" keyPath="labelWidthWeight">
|
<userDefinedRuntimeAttribute type="number" keyPath="labelWidthWeight">
|
||||||
<real key="value" value="0.69999999999999996"/>
|
<real key="value" value="0.69999999999999996"/>
|
||||||
|
|
@ -115,7 +112,7 @@
|
||||||
<integer key="value" value="0"/>
|
<integer key="value" value="0"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="limitHitAnimationColor">
|
||||||
<color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="0.98624199629999998" green="0.77968657019999998" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
|
<userDefinedRuntimeAttribute type="number" keyPath="maximumValue">
|
||||||
<integer key="value" value="100"/>
|
<integer key="value" value="100"/>
|
||||||
|
|
@ -128,8 +125,7 @@
|
||||||
</variation>
|
</variation>
|
||||||
</view>
|
</view>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Ri-Yr-sRs" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Ri-Yr-sRs" customClass="GMStepper" customModule="GMStepperExample" customModuleProvider="target">
|
||||||
<rect key="frame" x="210" y="424" width="180" height="50"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="width" constant="180" id="dhO-Nd-SFk"/>
|
<constraint firstAttribute="width" constant="180" id="dhO-Nd-SFk"/>
|
||||||
<constraint firstAttribute="height" constant="50" id="xPS-vU-cZc"/>
|
<constraint firstAttribute="height" constant="50" id="xPS-vU-cZc"/>
|
||||||
|
|
@ -148,24 +144,24 @@
|
||||||
<real key="value" value="4"/>
|
<real key="value" value="4"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsBackgroundColor">
|
||||||
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="buttonsTextColor">
|
||||||
<color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
|
||||||
<color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelBackgroundColor">
|
||||||
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
<color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
<userDefinedRuntimeAttribute type="color" keyPath="labelTextColor">
|
||||||
<color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="value" red="1" green="0.47058823529999999" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</userDefinedRuntimeAttribute>
|
</userDefinedRuntimeAttribute>
|
||||||
</userDefinedRuntimeAttributes>
|
</userDefinedRuntimeAttributes>
|
||||||
</view>
|
</view>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="R9n-I0-fq7" firstAttribute="centerX" secondItem="U8X-8Z-7Mo" secondAttribute="centerX" id="3cD-WW-Qg4"/>
|
<constraint firstItem="R9n-I0-fq7" firstAttribute="centerX" secondItem="U8X-8Z-7Mo" secondAttribute="centerX" id="3cD-WW-Qg4"/>
|
||||||
<constraint firstItem="if7-U5-bAM" firstAttribute="top" secondItem="AU6-4C-B2F" secondAttribute="bottom" constant="44" id="662-W9-CUn"/>
|
<constraint firstItem="if7-U5-bAM" firstAttribute="top" secondItem="AU6-4C-B2F" secondAttribute="bottom" constant="44" id="662-W9-CUn"/>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class ViewController: UIViewController {
|
||||||
stepper.addTarget(self, action: #selector(ViewController.stepperValueChanged), for: .valueChanged)
|
stepper.addTarget(self, action: #selector(ViewController.stepperValueChanged), for: .valueChanged)
|
||||||
}
|
}
|
||||||
|
|
||||||
func stepperValueChanged(stepper: GMStepper) {
|
@objc func stepperValueChanged(stepper: GMStepper) {
|
||||||
print(stepper.value, terminator: "")
|
print(stepper.value, terminator: "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
// Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved.
|
// Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
import UIKit
|
||||||
|
|
||||||
class GMStepperExampleTests: XCTestCase {
|
class GMStepperExampleTests: XCTestCase {
|
||||||
var stepper: GMStepper!
|
var stepper: GMStepper!
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,6 @@
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
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/).
|
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/).
|
||||||
|
|
||||||
|
|
||||||
## Screenshot
|
## Screenshot
|
||||||
|
|
||||||

|

|
||||||
|
|
@ -68,6 +69,9 @@ var labelBackgroundColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, alph
|
||||||
/// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
|
/// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.
|
||||||
var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)
|
var labelFont = UIFont(name: "AvenirNext-Bold", size: 25.0)
|
||||||
|
|
||||||
|
/// Corner radius of the middle label's layer. Defaults to 0.0.
|
||||||
|
var labelCornerRadius: CGFloat = 0.0
|
||||||
|
|
||||||
/// Corner radius of the stepper's layer. Defaults to 4.0.
|
/// Corner radius of the stepper's layer. Defaults to 4.0.
|
||||||
var cornerRadius: CGFloat = 4.0
|
var cornerRadius: CGFloat = 4.0
|
||||||
|
|
||||||
|
|
@ -85,9 +89,10 @@ var limitHitAnimationColor: UIColor = UIColor(red:0.26, green:0.6, blue:0.87, al
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Author
|
## Authors
|
||||||
|
|
||||||
Günay Mert Karadoğan, mertkaradogan@gmail.com
|
* [Brent Whitman](https://github.com/bwhtmn) - Maintainer
|
||||||
|
* [Günay Mert Karadoğan](https://github.com/gmertk) - Creator
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue