When do we need button to send argument in Swift?
问题 When connecting a button in Xcode as @IBAction func, we can choose between Arguments: Sender or None. When do we choose Sender and when None? 回答1: Well, if the action method needs to know which button triggered it, or can make use of any of the button's properties, then you would need to pass the sender (the button) to the method. A contrived example for this would be if you have a calculator, which has a '+' and a '-' button. They both could share the action method performCalculation(sender: