How to Hide/Show StackView form code

As stated in the title, I want to hide or show a StackView when a menu item is selected, which in turn changes a global variable.

How do I access the identity or handle of the StackView?

Answered by Claude31 in 684613022

Create an IBOutlet for the stackView and connect to the StackView in IB.

@IBOutlet weak var myStack: UIStackView!

And use it as needed in code.

myStack.isHidden = true
myStack.isHidden = false
Accepted Answer

Create an IBOutlet for the stackView and connect to the StackView in IB.

@IBOutlet weak var myStack: UIStackView!

And use it as needed in code.

myStack.isHidden = true
myStack.isHidden = false

Thank you, Claude31! I should have thought of that.

How to Hide/Show StackView form code
 
 
Q