我有一个标题设置为“计算器”的按钮当点击我的视图控制器中的这个按钮时,它会隐藏并显示一堆对象,并将按钮的标题更改为“返回”:
@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)
}
当标题设置为“返回”并且单击该按钮时,我希望显示隐藏的所有内容以及显示隐藏的所有内容。当标题设置为“计算器”时,我希望上述代码中的所有内容都发生。我怎样才能做到这一点?