Lukesivi
Lukesivi

Reputation: 2226

Stop all UIButtons from working when I tap 1 UIButton swift

I want to make it so that when I tap a UIButton, the rest of buttons are disabled until I click a refresh button.

I have 5 IBOutlets that I want to disable not including the refresh Button. Is there a function that stops the events that I can tie to the rest of the buttons? I don't even know where to start.

Thanks a lot in advance!

Upvotes: 1

Views: 1041

Answers (2)

Lukesivi
Lukesivi

Reputation: 2226

Hey so I got it to work! I did some more research and there's a duplicate of this post. Everything is explained here:

Disable and Enable UIButton - XCode Swift

Thanks a lot anyways.

Upvotes: 0

Pinturikkio
Pinturikkio

Reputation: 1500

Connects a method (IBAction) to the button that must disable other. Within the method, for each button (connected in the GUI) type the follow line:

button.enabled = false

Upvotes: 2

Related Questions