Contents

updateConfiguration()

Updates the button configuration in response to a button state change.

Declaration

func updateConfiguration()

Discussion

Override this method in your subclass to respond changes to the button’s state. Make any necessary changes and update the button’s configuration.

Don’t call this method directly. Call setNeedsUpdateConfiguration() to request an update to your button.

In iOS 18 and later, UIKit supports automatic trait tracking inside this method for traits from this button’s traitCollection. For more information, see Automatic trait tracking.

This method supports automatic observation tracking. For more information, see Updating views automatically with observation tracking.

See Also

Observing data in buttons