rocket101 rocket101 - 2 months ago 17
Swift Question

Hiding UIBUTTON swift

In swift, how do I hide a UIButton?

Here's what I tried:

button.enabled = false


However, that just greys out the button, not making it invisible.

Is there a way to do it in swift? If so, how?

Thanks!

Answer

Umm… button.hidden = true. See UIView Class Reference.

Be sure to look at methods available in parent classes when reading the documentation for a class.