Reputation: 408
So I'm new to Swift, but trying to figure out how to disable this button when it is pressed. I have the following:
@IBAction func IBbtnUpdateTap(sender: UIButton){
if imageNumber == 0 {
IBbtnUpdateTap.enabled = false
}
I'm not sure why it's giving me problems. Any ideas?
Upvotes: 0
Views: 102
Reputation: 10327
IBbtnUpdateTap
isn't the button. The button is sender
@IBAction func IBbtnUpdateTap(sender: UIButton){
if imageNumber == 0 {
sender.enabled = false
}
Upvotes: 3