FUIStateTintable
public protocol FUIStateTintable : AnyObject
The protocol denotes that the component could have different tint colors for different tint states. Typically not used by developer.
-
The control state.
Declaration
Swift
var state: UIControlState { get } -
This function is invoked after a state is changed.
Declaration
Swift
func stateDidChange() -
The tint color for the current control state.
Declaration
Swift
var tintColor: UIColor! { get set } -
Sets the tint color for the specified control state.
Declaration
Swift
func setTintColor(_ color: UIColor, for state: UIControlState)Parameters
colorThe tint color to be set.
stateThe state for the tint color to be set.
-
Gets the tint color for the specified control state.
Declaration
Swift
func tintColor(for state: UIControlState) -> UIColor?Parameters
stateThe specified control state.
-
stateDidChange()Default implementationDefault Implementation
Should be invoked by controls, when state is changed. Technique for doing this may vary. Controls are responsible for invoking correclty.
Declaration
Swift
public func stateDidChange() -
tintColor(for:)Default implementationDefault Implementation
Public getter to read tint color from backing dictionary
Declaration
Swift
public func tintColor(for state: UIControlState) -> UIColor?Return Value
if not
.normalstate, reads from backing dictionary. If.normal, returnsself.tintColor. (This solves the issue, where an unsettintColorshould return color fromsuper.
-
stateDefault implementationDefault Implementation
Tintable state as
UIControlStateDeclaration
Swift
public var state: UIControlState { get }