From 790fa208db995cdaf380a937070ee78159e1bb63 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 21 Oct 2022 17:07:45 -0500 Subject: [PATCH] added isAnimated logic Signed-off-by: Matt Bruce --- VDS/Components/Toggle/Toggle.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VDS/Components/Toggle/Toggle.swift b/VDS/Components/Toggle/Toggle.swift index 5e43393d..17c74373 100644 --- a/VDS/Components/Toggle/Toggle.swift +++ b/VDS/Components/Toggle/Toggle.swift @@ -136,6 +136,8 @@ open class ToggleBase: Control, Accessable, DataTrackable, BinaryColorable { // MARK: - Public Properties //-------------------------------------------------- open var isOn: Bool = false { didSet { didChange() }} + + open var isAnimated: Bool = true { didSet { didChange() }} open var showText: Bool = false { didSet { didChange() }} @@ -200,7 +202,7 @@ open class ToggleBase: Control, Accessable, DataTrackable, BinaryColorable { let toggleColor = toggleColorConfiguration.getColor(self) let knobColor = knobColorConfiguration.getColor(self) - if disabled { + if disabled || !isAnimated { toggleView.backgroundColor = toggleColor knobView.backgroundColor = knobColor constrainKnob()