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?

Accepted Reply

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

Replies

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.