UIViewConfigurationState
A structure that encapsulates a view’s state.
Declaration
struct UIViewConfigurationStateOverview
A view configuration state encompasses a trait collection along with all of the common states that affect a view’s appearance — states like selected, focused, or disabled. A view configuration state encapsulates the inputs that configure a view for any possible state or combination of states. You use a view configuration state with background and content configurations to obtain the default appearance for a specific state.
Typically, you don’t create a configuration state yourself. To obtain a configuration state, override the updateConfiguration(using:) method in your view subclass and use the state parameter. Outside of this method, you can get a view’s configuration state by using its configurationState property.
You can create your own custom states to add to a view configuration state by defining a custom state key using UIConfigurationStateCustomKey.