How can attributes be modified from the sender in swift? For example, if I have a multiple buttons that are connected to the same event handler, how can I modify the attributes of the button (say, the title) that was pressed?
@IBOutlet weak var grade_preK: UIButton!
@IBAction func gradeButtonPressed(sender: AnyObject) {
sender.title = "New Title"
}
The handler here returns the error "Cannot assign to 'title' in 'sender'". How then, can attributes be changed on the sender of the event?