addAction method

void addAction(
  1. UIAction action, {
  2. required UIControlEvents forControlEvents,
})

Adds the UIAction to a given event. UIActions are uniqued based on their identifier, and subsequent actions with the same identifier replace previously added actions. You may add multiple UIActions for corresponding controlEvents, and you may add the same action to multiple controlEvents.

Implementation

void addAction(UIAction action, {required UIControlEvents forControlEvents}) {
  objc.checkOsVersionInternal('UIControl.addAction:forControlEvents:', iOS: (false, (14, 0, 0)));
  _objc_msgSend_10736wn(
    this.ref.pointer,
    _sel_addAction_forControlEvents_,
    action.ref.pointer,
    forControlEvents.value,
  );
}