co-maps/iphone/Maps/Core/Theme/Renderers/UISwitchRenderer.swift
2025-11-22 13:58:55 +01:00

20 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
}
}
}