How do I programmatically hide or show the START SESSION button in a scene’s view controller that navigates to the next scene?
2
create an outlet to your button in the view controller class:
@IBOutlet weak var startButton: UIButton!
and then in whichever function you want you can show hide it, I assume you want it hidden by default So in view did load you can do
override func viewDidLoad() { startButton.isHidden = true }
and then show it somewhere else
func doSomethingAndShowButton() { // Do some other stuff ... // Show the button startButton.isHidden = false }
@Doug Null To connect the @IBOutlet. First, follow what @AngrayDuck said. After that do as following:
Hope this helps.
Click here to cancel reply.
2
Answers
create an outlet to your button in the view controller class:
and then in whichever function you want you can show hide it, I assume you want it hidden by default So in view did load you can do
and then show it somewhere else
@Doug Null To connect the @IBOutlet. First, follow what @AngrayDuck said. After that do as following:
Hope this helps.