Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 32f6a6d397 | |||
| 0523e2578c |
+1
-1
@@ -1,7 +1,7 @@
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
s.name = 'OGSwitch'
|
||||
s.version = '1.5'
|
||||
s.version = '1.7'
|
||||
s.summary = 'Switch with icon'
|
||||
s.homepage = 'https://github.com/OskarGroth/OGSwitch'
|
||||
s.license = {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "77"
|
||||
endingLineNumber = "77"
|
||||
landmarkName = "setupIcon()"
|
||||
landmarkName = "init(coder:)"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
<Location
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user