configurationUpdateHandler
A closure that executes when the button state changes.
Declaration
var configurationUpdateHandler: UIButton.ConfigurationUpdateHandler? { get set }Discussion
Use this property as an alternative to overriding updateConfiguration(). Set a closure to respond to button state changes by updating the button configuration.
In iOS 18 and later, UIKit supports automatic trait tracking inside this closure for traits from this button’s traitCollection. For more information, see Automatic trait tracking.
This closure supports automatic observation tracking. For more information, see Updating views automatically with observation tracking.