More comments.

This commit is contained in:
Kevin G Christiano 2019-12-11 16:03:01 -05:00
parent 98997bfa80
commit 639330ad5b

View File

@ -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