UIButtonConfiguration and button disabled state

I am trying to use the UIButtonConfiguration to set the UI state for the button.isEnabled status. I do see the ConfigurationUpdateHandler code below being executed but when the button.isEnabled is set to false, the UI does not reflect the updated backgroundColor. Instead it is a very light gray but the foregroundColor/text is being updated. It seems that the default disabled button treatment is being used despite being set to a different color. Is there a better way to suppress the default UIButton disabled state so I can customize?

[newButton setConfigurationUpdateHandler:^(__kindof UIButton * _Nonnull button) {
            UIButtonConfiguration *updatedConfiguration;
            if (newButton.configuration != nil) {
                updatedConfiguration = newButton.configuration;
              
                if (button.isEnabled) {
                    updatedConfiguration.baseBackgroundColor = [UIColor darkGrayColor];
                    updatedConfiguration.baseForegroundColor = [UIColor whiteColor];
                } else {
                    updatedConfiguration.baseBackgroundColor = [UIColor greenColor];
                    updatedConfiguration.baseForegroundColor = [UIColor blackColor];
                }
            }
            button.configuration = updatedConfiguration;
        }];

The baseBackgroundColor and baseForegroundColor exist to allow you to theme the button while maintaining the treatments that UIKit would normally apply. For example if you want the button to go from generally blue to generally red when you select it, you would use these properties.

If you want very specific colors/changes then you need to apply your customizations to the specific elements that you want to change. For example if you want the label to use YourProductBlue when deselected and YourProductRed when selected, then you need to customize the label text attributes – if you use the baseForegroundColor for that, then UIKit may apply further modifications on top of that.

The disabled state is probably one of the more drastic color manipulations that UIKit does by default, as when the button is disabled we want to make it look like it is non interactive, and we do that primarily by desaturating the colors used. So if you want your button to behave differently when disabled, you will need to apply your customizations directly to each element. You can still use the baseBackgroundColor & baseForegroundColor to affect elements that you don't wish to specifically customize in this way.

UIButtonConfiguration and button disabled state
 
 
Q