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
color
The tint color to be set.
state
The 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
state
The 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
.normal
state, reads from backing dictionary. If.normal
, returnsself.tintColor
. (This solves the issue, where an unsettintColor
should return color fromsuper
.
-
state
Default implementationDefault Implementation
Tintable state as
UIControlState
Declaration
Swift
public var state: UIControlState { get }