From 639330ad5bd56755a03c35cb232c006c02910869 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 11 Dec 2019 16:03:01 -0500 Subject: [PATCH] More comments. --- MVMCoreUI/Atoms/Views/Toggle.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MVMCoreUI/Atoms/Views/Toggle.swift b/MVMCoreUI/Atoms/Views/Toggle.swift index b49104c5..2d056d24 100644 --- a/MVMCoreUI/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atoms/Views/Toggle.swift @@ -24,10 +24,16 @@ public typealias ActionBlockConfirmation = () -> (Bool) // MARK: - Properties //-------------------------------------------------- + /// Holds the on and off colors for the container. public var containerTintColor: (on: UIColor?, off: UIColor?)? = (on: .mfShamrock(), off: .black) + + /// Holds the on and off colors for the knob. public var knobTintColor: (on: UIColor?, off: UIColor?)? = (on: .white, off: .white) + + /// Holds the on and off colors for the disabled state.. public var disabledTintColor: (container: UIColor?, knob: UIColor?)? = (container: .mfSilver(), knob: .white) + /// Set this flag to false if you do not want to animate state changes. public var isAnimated = true public var didToggleAction: ActionBlock? @@ -61,12 +67,14 @@ public typealias ActionBlockConfirmation = () -> (Bool) } } + /// Simple means to prevent user interaction with the toggle. public var isLocked: Bool = false { didSet { isUserInteractionEnabled = !isLocked } } + /// The state on the toggle. Default value: false. open var isOn: Bool = false { didSet { isSelected = isOn