Skip to content

Commit

Permalink
Writable isOn
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Apr 8, 2024
1 parent f60b00d commit ca0811c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Sources/CommonAppleKit/CommonAppleKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,17 @@

public extension CASwitch {
var isOn: Bool {
state == .on
get {
state == .on
}

set {
if newValue {
state = .on
} else {
state = .off
}
}
}
}

Expand Down

0 comments on commit ca0811c

Please sign in to comment.