mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 05:43:37 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
21 lines
534 B
Swift
21 lines
534 B
Swift
extension UISwitch {
|
|
@objc override func applyTheme() {
|
|
if styleName.isEmpty {
|
|
setStyle(.switch)
|
|
}
|
|
for style in StyleManager.shared.getStyle(styleName)
|
|
where !style.isEmpty && !style.hasExclusion(view: self) {
|
|
UISwitchRenderer.render(self, style: style)
|
|
}
|
|
}
|
|
}
|
|
|
|
class UISwitchRenderer: UIViewRenderer {
|
|
class func render(_ control: UISwitch, style: Style) {
|
|
super.render(control, style: style)
|
|
if let onTintColor = style.onTintColor {
|
|
control.onTintColor = onTintColor
|
|
}
|
|
}
|
|
}
|