11

I've just started with coding and I really want to know how to hide buttons.

What I want to do is when I press my button:

Start: I want to let the start button and the back button disappear.

It's done with Outlets and Actions.

I already searched a bit but when I wanted to do it, it said that the do keyword is expected to designate a block of statements.

I hope someone can help me out.

Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143
J. Aberson
  • 121
  • 1
  • 1
  • 3

1 Answers1

20

Once you have your outlets connected, simply change the isHidden property to true.

IBOutlet weak var startButton: UIButton
IBOutlet weak var backButton: UIButton

IBAction func tapStart(sender: AnyObject?){
   self.startButton.isHidden = true
   self.backButton.isHidden = true
}
TheValyreanGroup
  • 3,554
  • 2
  • 12
  • 30