All @IBAction
functions have one of three signatures;
functionName() -> Void
functionName(sender: Any) -> Void
functionName(sender: Any, forEvent event: UIEvent) -> Void
An IBAction cannot accept any other arguments and does not return a value.
A delegate allows the use of functions that take different parameters and return values while actions are a standard approach across UIView
subclasses.
In some classes, such as UITextField
, certain action can be handled through both delegate and action methods. I guess this just gives you some choice; if you are already implementing delegate functions then you don't need to implement action handlers as well.