1 Commits

Author SHA1 Message Date
Oskar Groth 0523e2578c SetOn 2017-04-10 09:56:21 +02:00
3 changed files with 9 additions and 1 deletions
@@ -15,7 +15,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "77"
endingLineNumber = "77"
landmarkName = "setupIcon()"
landmarkName = "init(coder:)"
landmarkType = "7">
<Locations>
<Location
+7
View File
@@ -93,6 +93,13 @@ public class OGSwitch : NSControl {
setupIcon()
}
public func setOn(isOn: Bool, animated: Bool) {
if self.isOn != isOn {
self.isOn = isOn
reloadLayerAnimated(animated: animated)
}
}
internal func setupIcon() {
guard let icon = inactiveIcon, let bounds = knobLayer?.bounds else {
return
+1
View File
@@ -30,6 +30,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
@objc func timer() {
print("Trim is after now: \(switchButton.isOn)")
switchButton.setOn(isOn: !switchButton.isOn, animated: false)
}
}