Whats the difference between `UIControlState()` and `UIControlState.normal` when configuring an object

Viewed 3381

I usually seen UIControlState.normal used, for example to set a titleColor on a UIButton object that will be used among all control states, as the UIButton. setTitleColor docs says:

In general, if a property is not specified for a state, the default is to use the normal value. If the normal value is not set, then the property defaults to a system value. Therefore, at a minimum, you should set the value for the normal state.

But I have also found UIControlState.init() being used, for example following line:

UIButton.setTitleColor(UIColor, for: UIControlState())

Was wondering how it differs, thanks in advance!

2 Answers
Related