UICommand
public extension UICommand
-
Updates a command to reflect the current state of a bound action.
Sets the attributes of the command to be disabled if the action is
nilor if the action can’t be performed right now. Optionally updates the title of the command.This can be used in
UIResponder.validate(_:)to update the command for a menu item before it is about to be displayed.Declaration
Swift
func update<T>(_ action: BoundUserAction<T>?, updateTitle: Bool = false)Parameters
actionThe bound action whose state should be reflected in the command.
updateTitleWhether to also update the title of the command. Defaults to false.
View on GitHub
UICommand Extension Reference