I have a button that's title is set to "calculator" When this button in my view controller is tapped, it hides and shows a bunch of objects and it changes to the title of the button to "back":
@IBAction func calculatorButtonTapped(sender: AnyObject) {
calculatorContainer.hidden = false
inspirationLabel.hidden = true
beginningLabel.hidden = true
menuExampleButton.hidden = true
aboutButton.hidden = true
calculatorButton.setTitle("Back", forState: UIControlState.Normal)
}
When the title is set to "back", and when that button is clicked, I want everything that was hidden to be shown and everything that was shown to be hidden. When the title is set to "calculator", I want everything from the above code to occur. How can I do this?
You can try this code:
This will switch back and forth between hidden and not hiding your image.