Merge pull request #33 from bwhtmn/touchCancel
Reset timer when button touches are cancelled
This commit is contained in:
commit
44f1477df1
|
|
@ -177,6 +177,7 @@ import UIKit
|
|||
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: .touchUpOutside)
|
||||
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
|
||||
return button
|
||||
}()
|
||||
|
||||
|
|
@ -189,6 +190,7 @@ import UIKit
|
|||
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: .touchUpOutside)
|
||||
button.addTarget(self, action: #selector(GMStepper.buttonTouchUp), for: .touchCancel)
|
||||
return button
|
||||
}()
|
||||
|
||||
|
|
@ -298,6 +300,7 @@ import UIKit
|
|||
backgroundColor = buttonsBackgroundColor
|
||||
layer.cornerRadius = cornerRadius
|
||||
clipsToBounds = true
|
||||
labelOriginalCenter = label.center
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(GMStepper.reset), name: NSNotification.Name.UIApplicationWillResignActive, object: nil)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue